12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = getISOWeeksInYear;
- var _index = _interopRequireDefault(require("../startOfISOWeekYear/index.js"));
- var _index2 = _interopRequireDefault(require("../addWeeks/index.js"));
- var _index3 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var MILLISECONDS_IN_WEEK = 604800000;
- function getISOWeeksInYear(dirtyDate) {
- (0, _index3.default)(1, arguments);
- var thisYear = (0, _index.default)(dirtyDate);
- var nextYear = (0, _index.default)((0, _index2.default)(thisYear, 60));
- var diff = nextYear.valueOf() - thisYear.valueOf();
-
-
- return Math.round(diff / MILLISECONDS_IN_WEEK);
- }
- module.exports = exports.default;
|