index.js 711 B

123456789101112131415161718192021222324
  1. var isSameISOWeek = require('../is_same_iso_week/index.js')
  2. /**
  3. * @category ISO Week Helpers
  4. * @summary Is the given date in the same ISO week as the current date?
  5. *
  6. * @description
  7. * Is the given date in the same ISO week as the current date?
  8. *
  9. * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
  10. *
  11. * @param {Date|String|Number} date - the date to check
  12. * @returns {Boolean} the date is in this ISO week
  13. *
  14. * @example
  15. * // If today is 25 September 2014, is 22 September 2014 in this ISO week?
  16. * var result = isThisISOWeek(new Date(2014, 8, 22))
  17. * //=> true
  18. */
  19. function isThisISOWeek (dirtyDate) {
  20. return isSameISOWeek(new Date(), dirtyDate)
  21. }
  22. module.exports = isThisISOWeek