index.js 826 B

12345678910111213141516171819202122232425262728
  1. var isSameWeek = require('../is_same_week/index.js')
  2. /**
  3. * @category ISO Week Helpers
  4. * @summary Are the given dates in the same ISO week?
  5. *
  6. * @description
  7. * Are the given dates in the same ISO week?
  8. *
  9. * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
  10. *
  11. * @param {Date|String|Number} dateLeft - the first date to check
  12. * @param {Date|String|Number} dateRight - the second date to check
  13. * @returns {Boolean} the dates are in the same ISO week
  14. *
  15. * @example
  16. * // Are 1 September 2014 and 7 September 2014 in the same ISO week?
  17. * var result = isSameISOWeek(
  18. * new Date(2014, 8, 1),
  19. * new Date(2014, 8, 7)
  20. * )
  21. * //=> true
  22. */
  23. function isSameISOWeek (dirtyDateLeft, dirtyDateRight) {
  24. return isSameWeek(dirtyDateLeft, dirtyDateRight, {weekStartsOn: 1})
  25. }
  26. module.exports = isSameISOWeek