index.js 609 B

12345678910111213141516171819202122
  1. var isSameMonth = require('../is_same_month/index.js')
  2. /**
  3. * @category Month Helpers
  4. * @summary Is the given date in the same month as the current date?
  5. *
  6. * @description
  7. * Is the given date in the same month as the current date?
  8. *
  9. * @param {Date|String|Number} date - the date to check
  10. * @returns {Boolean} the date is in this month
  11. *
  12. * @example
  13. * // If today is 25 September 2014, is 15 September 2014 in this month?
  14. * var result = isThisMonth(new Date(2014, 8, 15))
  15. * //=> true
  16. */
  17. function isThisMonth (dirtyDate) {
  18. return isSameMonth(new Date(), dirtyDate)
  19. }
  20. module.exports = isThisMonth