87 lines
2.4 KiB
JavaScript
87 lines
2.4 KiB
JavaScript
// Metro module 3552 (f3553).
|
|
import * as _getDate from "./getDate";
|
|
import { __esModule } from "./getDate";
|
|
import * as _getDay from "./getDay";
|
|
import * as _startOfMonth from "./startOfMonth";
|
|
import * as _requiredArgs from "./requiredArgs";
|
|
import * as _toInteger from "./toInteger";
|
|
import { getDefaultOptions } from "./Module3273";
|
|
let c1904_2, c1904_3, c1904_4, c1904_5, c1904_6;
|
|
export default function getWeekOfMonth(a0, a1) {
|
|
(0, c1904_5.default)(1, arguments);
|
|
const r23 = (0, getDefaultOptions)();
|
|
const default2 = c1904_6.default;
|
|
let r9 = a1?.weekStartsOn;
|
|
if (!(r9 !== null && r9 !== void 0)) {
|
|
const r26 = a1 == null;
|
|
let r10 = void 0;
|
|
if (!r26) {
|
|
const locale = a1.locale;
|
|
r10 = void 0;
|
|
if (locale !== null) {
|
|
r10 = void 0;
|
|
if (locale !== void 0) {
|
|
const options = locale.options;
|
|
r10 = options !== null ? options !== void 0 ? options.weekStartsOn : void 0 : void 0;
|
|
}
|
|
}
|
|
}
|
|
r9 = r10;
|
|
}
|
|
if (!(r9 !== null && r9 !== void 0)) {
|
|
r9 = r23.weekStartsOn;
|
|
}
|
|
if (!(r9 !== null && r9 !== void 0)) {
|
|
const locale2 = r23.locale;
|
|
let r30 = void 0;
|
|
if (locale2 !== null) {
|
|
r30 = void 0;
|
|
if (locale2 !== void 0) {
|
|
const options2 = locale2.options;
|
|
r30 = options2 !== null ? options2 !== void 0 ? options2.weekStartsOn : void 0 : void 0;
|
|
}
|
|
}
|
|
r9 = r30;
|
|
}
|
|
const r33 = default2(r9 !== null ? r9 !== void 0 ? r9 : 0 : 0);
|
|
if (r33 >= 0 && r33 <= 6) {
|
|
const r42 = (0, c1904_2.default)(a0);
|
|
if (isNaN(r42)) {
|
|
return NaN;
|
|
}
|
|
const r52 = r33 - (0, c1904_3.default)((0, c1904_4.default)(a0));
|
|
let r53 = r52;
|
|
if (r53 <= 0) {
|
|
r53 = r52 + 7;
|
|
}
|
|
return Math.ceil((r42 - r53) / 7) + 1;
|
|
}
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
};
|
|
c1904_2 = _getDate ? __esModule ? _getDate : {
|
|
default: _getDate
|
|
} : {
|
|
default: _getDate
|
|
};
|
|
c1904_3 = _getDay ? _getDay.__esModule ? _getDay : {
|
|
default: _getDay
|
|
} : {
|
|
default: _getDay
|
|
};
|
|
c1904_4 = _startOfMonth ? _startOfMonth.__esModule ? _startOfMonth : {
|
|
default: _startOfMonth
|
|
} : {
|
|
default: _startOfMonth
|
|
};
|
|
c1904_5 = _requiredArgs ? _requiredArgs.__esModule ? _requiredArgs : {
|
|
default: _requiredArgs
|
|
} : {
|
|
default: _requiredArgs
|
|
};
|
|
c1904_6 = _toInteger ? _toInteger.__esModule ? _toInteger : {
|
|
default: _toInteger
|
|
} : {
|
|
default: _toInteger
|
|
};
|
|
module.exports = exports.default;
|