103 lines
2.6 KiB
JavaScript
103 lines
2.6 KiB
JavaScript
// Module ID: 3271
|
|
// Function ID: 3272
|
|
// Name: startOfUTCWeek
|
|
// Dependencies: [3268, 3269, 3272, 3273]
|
|
// Exports: default
|
|
|
|
// Module 3271 (startOfUTCWeek)
|
|
import _typeof from "_typeof";
|
|
import requiredArgs from "requiredArgs";
|
|
import toInteger from "toInteger";
|
|
|
|
if (!_typeof) {
|
|
let obj = { default: null };
|
|
obj[0] = _typeof;
|
|
let tmp3 = obj;
|
|
} else {
|
|
tmp3 = _typeof;
|
|
}
|
|
if (!requiredArgs) {
|
|
obj = { default: null };
|
|
obj[0] = requiredArgs;
|
|
let tmp5 = obj;
|
|
} else {
|
|
tmp5 = requiredArgs;
|
|
}
|
|
let c3 = tmp5;
|
|
if (!toInteger) {
|
|
obj = { default: null };
|
|
obj[0] = toInteger;
|
|
let tmp7 = obj;
|
|
} else {
|
|
tmp7 = toInteger;
|
|
}
|
|
let c4 = tmp7;
|
|
|
|
export default function startOfUTCWeek(arg0, weekStartsOn) {
|
|
tmp5.default(1, arguments);
|
|
const defaultOptions = require(3273) /* getDefaultOptions */.getDefaultOptions();
|
|
weekStartsOn = undefined;
|
|
if (null != weekStartsOn) {
|
|
weekStartsOn = weekStartsOn.weekStartsOn;
|
|
}
|
|
if (null === weekStartsOn) {
|
|
let weekStartsOn1;
|
|
if (null != weekStartsOn) {
|
|
const locale = weekStartsOn.locale;
|
|
if (null !== locale) {
|
|
if (undefined !== locale) {
|
|
const options = locale.options;
|
|
if (null !== options) {
|
|
if (undefined !== options) {
|
|
weekStartsOn1 = options.weekStartsOn;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
weekStartsOn = weekStartsOn1;
|
|
}
|
|
if (null === weekStartsOn) {
|
|
weekStartsOn = defaultOptions.weekStartsOn;
|
|
}
|
|
if (null === weekStartsOn) {
|
|
const locale2 = defaultOptions.locale;
|
|
let weekStartsOn2;
|
|
if (null !== locale2) {
|
|
if (undefined !== locale2) {
|
|
const options2 = locale2.options;
|
|
if (null !== options2) {
|
|
if (undefined !== options2) {
|
|
weekStartsOn2 = options2.weekStartsOn;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
weekStartsOn = weekStartsOn2;
|
|
}
|
|
let num = 0;
|
|
if (null !== weekStartsOn) {
|
|
num = 0;
|
|
if (undefined !== weekStartsOn) {
|
|
num = weekStartsOn;
|
|
}
|
|
}
|
|
const defaultResult1 = tmp7.default(num);
|
|
if (defaultResult1 >= 0) {
|
|
if (defaultResult1 <= 6) {
|
|
const defaultResult2 = tmp3.default(arg0);
|
|
const uTCDay = defaultResult2.getUTCDay();
|
|
let num3 = 0;
|
|
if (uTCDay < defaultResult1) {
|
|
num3 = 7;
|
|
}
|
|
const diff = num3 + uTCDay - defaultResult1;
|
|
defaultResult2.setUTCDate(defaultResult2.getUTCDate() - diff);
|
|
defaultResult2.setUTCHours(0, 0, 0, 0);
|
|
return defaultResult2;
|
|
}
|
|
}
|
|
const rangeError = new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
throw rangeError;
|
|
};
|
|
export default exports.default;
|