index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = endOfISOWeek;
  6. var _index = _interopRequireDefault(require("../endOfWeek/index.js"));
  7. var _index2 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. /**
  10. * @name endOfISOWeek
  11. * @category ISO Week Helpers
  12. * @summary Return the end of an ISO week for the given date.
  13. *
  14. * @description
  15. * Return the end of an ISO week for the given date.
  16. * The result will be in the local timezone.
  17. *
  18. * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
  19. *
  20. * ### v2.0.0 breaking changes:
  21. *
  22. * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
  23. *
  24. * @param {Date|Number} date - the original date
  25. * @returns {Date} the end of an ISO week
  26. * @throws {TypeError} 1 argument required
  27. *
  28. * @example
  29. * // The end of an ISO week for 2 September 2014 11:55:00:
  30. * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
  31. * //=> Sun Sep 07 2014 23:59:59.999
  32. */
  33. function endOfISOWeek(dirtyDate) {
  34. (0, _index2.default)(1, arguments);
  35. return (0, _index.default)(dirtyDate, {
  36. weekStartsOn: 1
  37. });
  38. }
  39. module.exports = exports.default;