decord/source/3485_startOfUTCWeekYear.js

70 lines
1.9 KiB
JavaScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 3485
// Function ID: 26889
2026-07-20 16:05:17 +00:00
// Name: startOfUTCWeekYear
2026-07-28 08:39:19 +00:00
// Dependencies: [3486, 3245, 3247, 3248, 3249]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-28 08:39:19 +00:00
// Module 3485 (startOfUTCWeekYear)
2026-07-23 10:11:24 +00:00
import getUTCWeekYear from "getUTCWeekYear";
import requiredArgs from "requiredArgs";
import startOfUTCWeek from "startOfUTCWeek";
import toInteger from "toInteger";
2026-07-20 16:05:17 +00:00
export default function startOfUTCWeekYear(defaultResult1, firstWeekContainsDate) {
2026-07-23 10:11:24 +00:00
requiredArgs.default(1, arguments);
2026-07-28 08:39:19 +00:00
const defaultOptions = require(3249) /* getDefaultOptions */.getDefaultOptions();
2026-07-20 16:05:17 +00:00
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;
}
}
2026-07-23 10:11:24 +00:00
defaultResult1 = toInteger.default(num);
2026-07-20 16:05:17 +00:00
const date = new Date(0);
2026-07-23 10:11:24 +00:00
date.setUTCFullYear(getUTCWeekYear.default(defaultResult1, firstWeekContainsDate), 0, defaultResult1);
2026-07-20 16:05:17 +00:00
date.setUTCHours(0, 0, 0, 0);
2026-07-23 10:11:24 +00:00
return startOfUTCWeek.default(date, firstWeekContainsDate);
2026-07-20 16:05:17 +00:00
};
export default exports.default;