Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
125 lines
3.3 KiB
JavaScript
125 lines
3.3 KiB
JavaScript
// Module ID: 4009
|
|
// Function ID: 4010
|
|
// Dependencies: [3885, 3726, 3730, 3727, 3731]
|
|
// Exports: default
|
|
|
|
// Module 4009
|
|
import _mod3731 from "module_3731" /* 3731 */;
|
|
import startOfWeek_mod from "startOfWeek" /* 3885 */;
|
|
import _typeof_mod from "module_3726" /* 3726 */;
|
|
import module_3730_mod from "module_3730" /* 3730 */;
|
|
import requiredArgs_mod from "requiredArgs" /* 3727 */;
|
|
|
|
let startOfWeek = startOfWeek_mod;
|
|
if (!startOfWeek) {
|
|
const obj = { default: startOfWeek };
|
|
let tmp3 = obj;
|
|
} else {
|
|
tmp3 = startOfWeek;
|
|
}
|
|
startOfWeek = tmp3;
|
|
let _typeof = _typeof_mod;
|
|
if (!_typeof) {
|
|
const obj2 = { default: _typeof };
|
|
let tmp5 = obj2;
|
|
} else {
|
|
tmp5 = _typeof;
|
|
}
|
|
_typeof = tmp5;
|
|
let module_3730 = module_3730_mod;
|
|
if (!module_3730) {
|
|
const obj3 = { default: module_3730 };
|
|
let tmp7 = obj3;
|
|
} else {
|
|
tmp7 = module_3730;
|
|
}
|
|
module_3730 = tmp7;
|
|
let requiredArgs = requiredArgs_mod;
|
|
if (!requiredArgs) {
|
|
const obj4 = { default: requiredArgs };
|
|
let tmp9 = obj4;
|
|
} else {
|
|
tmp9 = requiredArgs;
|
|
}
|
|
requiredArgs = tmp9;
|
|
|
|
export default function getWeekYear(arg0, firstWeekContainsDate) {
|
|
requiredArgs.default(1, arguments);
|
|
const defaultResult1 = _typeof.default(arg0);
|
|
const fullYear = defaultResult1.getFullYear();
|
|
const defaultOptions = _mod3731.getDefaultOptions();
|
|
let prop;
|
|
if (null != firstWeekContainsDate) {
|
|
prop = firstWeekContainsDate.firstWeekContainsDate;
|
|
}
|
|
if (null === prop) {
|
|
let prop1;
|
|
if (null != firstWeekContainsDate) {
|
|
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 = module_3730.default(num);
|
|
if (defaultResult2 >= 1) {
|
|
if (defaultResult2 <= 7) {
|
|
const _Date = Date;
|
|
const date = new Date(0);
|
|
date.setFullYear(fullYear + 1, 0, defaultResult2);
|
|
date.setHours(0, 0, 0, 0);
|
|
const _Date2 = Date;
|
|
const date1 = new Date(0);
|
|
date1.setFullYear(fullYear, 0, defaultResult2);
|
|
date1.setHours(0, 0, 0, 0);
|
|
const defaultResult3 = startOfWeek.default(date, firstWeekContainsDate);
|
|
const time = defaultResult1.getTime();
|
|
if (time >= defaultResult3.getTime()) {
|
|
let sum = fullYear + 1;
|
|
} else {
|
|
const time1 = defaultResult1.getTime();
|
|
sum = fullYear;
|
|
if (time1 < defaultResult4.getTime()) {
|
|
sum = fullYear - 1;
|
|
}
|
|
}
|
|
return sum;
|
|
}
|
|
}
|
|
const rangeError = new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
throw rangeError;
|
|
};
|
|
export default exports.default;
|