126 lines
3.3 KiB
JavaScript
126 lines
3.3 KiB
JavaScript
// Module ID: 3717
|
|
// Function ID: 3718
|
|
// Name: getUTCWeekYear
|
|
// Dependencies: [3475, 3476, 3478, 3479, 3480]
|
|
// Exports: default
|
|
|
|
// Module 3717 (getUTCWeekYear)
|
|
import getDefaultOptions from "getDefaultOptions" /* 3480 */;
|
|
import _typeof from "_typeof" /* 3475 */;
|
|
import requiredArgs from "requiredArgs" /* 3476 */;
|
|
import startOfUTCWeek from "startOfUTCWeek" /* 3478 */;
|
|
import toInteger from "toInteger" /* 3479 */;
|
|
|
|
if (!_typeof) {
|
|
let obj = { default: null };
|
|
obj[0] = _typeof;
|
|
let tmp3 = obj;
|
|
} else {
|
|
tmp3 = _typeof;
|
|
}
|
|
_typeof = tmp3;
|
|
if (!requiredArgs) {
|
|
obj = { default: null };
|
|
obj[0] = requiredArgs;
|
|
let tmp5 = obj;
|
|
} else {
|
|
tmp5 = requiredArgs;
|
|
}
|
|
requiredArgs = tmp5;
|
|
if (!startOfUTCWeek) {
|
|
obj = { default: null };
|
|
obj[0] = startOfUTCWeek;
|
|
let tmp7 = obj;
|
|
} else {
|
|
tmp7 = startOfUTCWeek;
|
|
}
|
|
startOfUTCWeek = tmp7;
|
|
if (!toInteger) {
|
|
const obj1 = { default: null };
|
|
obj1[0] = toInteger;
|
|
let tmp9 = obj1;
|
|
} else {
|
|
tmp9 = toInteger;
|
|
}
|
|
toInteger = tmp9;
|
|
|
|
export default function getUTCWeekYear(arg0, firstWeekContainsDate) {
|
|
requiredArgs.default(1, arguments);
|
|
const defaultResult1 = _typeof.default(arg0);
|
|
const uTCFullYear = defaultResult1.getUTCFullYear();
|
|
const defaultOptions = getDefaultOptions.getDefaultOptions();
|
|
let prop;
|
|
if (null != firstWeekContainsDate) {
|
|
prop = firstWeekContainsDate.firstWeekContainsDate;
|
|
}
|
|
if (null === prop) {
|
|
let prop1;
|
|
if (null != firstWeekContainsDate) {
|
|
const locale = firstWeekContainsDate.locale;
|
|
if (null !== locale) {
|
|
if (undefined !== locale) {
|
|
const options = locale.options;
|
|
if (null !== options) {
|
|
if (undefined !== options) {
|
|
prop1 = options.firstWeekContainsDate;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
prop = prop1;
|
|
}
|
|
if (null === prop) {
|
|
prop = defaultOptions.firstWeekContainsDate;
|
|
}
|
|
if (null === prop) {
|
|
const locale2 = defaultOptions.locale;
|
|
let prop2;
|
|
if (null !== locale2) {
|
|
if (undefined !== locale2) {
|
|
const options2 = locale2.options;
|
|
if (null !== options2) {
|
|
if (undefined !== options2) {
|
|
prop2 = options2.firstWeekContainsDate;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
prop = prop2;
|
|
}
|
|
let num = 1;
|
|
if (null !== prop) {
|
|
num = 1;
|
|
if (undefined !== prop) {
|
|
num = prop;
|
|
}
|
|
}
|
|
const defaultResult2 = toInteger.default(num);
|
|
if (defaultResult2 >= 1) {
|
|
if (defaultResult2 <= 7) {
|
|
const _Date = Date;
|
|
const date = new Date(0);
|
|
date.setUTCFullYear(uTCFullYear + 1, 0, defaultResult2);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
const _Date2 = Date;
|
|
const date1 = new Date(0);
|
|
date1.setUTCFullYear(uTCFullYear, 0, defaultResult2);
|
|
date1.setUTCHours(0, 0, 0, 0);
|
|
const defaultResult3 = startOfUTCWeek.default(date, firstWeekContainsDate);
|
|
const time = defaultResult1.getTime();
|
|
if (time >= defaultResult3.getTime()) {
|
|
let sum = uTCFullYear + 1;
|
|
} else {
|
|
const time1 = defaultResult1.getTime();
|
|
sum = uTCFullYear;
|
|
if (time1 < defaultResult4.getTime()) {
|
|
sum = uTCFullYear - 1;
|
|
}
|
|
}
|
|
return sum;
|
|
}
|
|
}
|
|
const rangeError = new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
throw rangeError;
|
|
};
|
|
export default exports.default;
|