index.js 959 B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = startOfUTCISOWeekYear;
  6. var _index = _interopRequireDefault(require("../getUTCISOWeekYear/index.js"));
  7. var _index2 = _interopRequireDefault(require("../startOfUTCISOWeek/index.js"));
  8. var _index3 = _interopRequireDefault(require("../requiredArgs/index.js"));
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. // This function will be a part of public API when UTC function will be implemented.
  11. // See issue: https://github.com/date-fns/date-fns/issues/376
  12. function startOfUTCISOWeekYear(dirtyDate) {
  13. (0, _index3.default)(1, arguments);
  14. var year = (0, _index.default)(dirtyDate);
  15. var fourthOfJanuary = new Date(0);
  16. fourthOfJanuary.setUTCFullYear(year, 0, 4);
  17. fourthOfJanuary.setUTCHours(0, 0, 0, 0);
  18. var date = (0, _index2.default)(fourthOfJanuary);
  19. return date;
  20. }
  21. module.exports = exports.default;