index.js 777 B

12345678910111213141516171819202122232425
  1. var lastDayOfWeek = require('../last_day_of_week/index.js')
  2. /**
  3. * @category ISO Week Helpers
  4. * @summary Return the last day of an ISO week for the given date.
  5. *
  6. * @description
  7. * Return the last day of an ISO week for the given date.
  8. * The result will be in the local timezone.
  9. *
  10. * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
  11. *
  12. * @param {Date|String|Number} date - the original date
  13. * @returns {Date} the last day of an ISO week
  14. *
  15. * @example
  16. * // The last day of an ISO week for 2 September 2014 11:55:00:
  17. * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
  18. * //=> Sun Sep 07 2014 00:00:00
  19. */
  20. function lastDayOfISOWeek (dirtyDate) {
  21. return lastDayOfWeek(dirtyDate, {weekStartsOn: 1})
  22. }
  23. module.exports = lastDayOfISOWeek