218 lines
7.7 KiB
JavaScript
218 lines
7.7 KiB
JavaScript
// Module ID: 10476
|
|
// Function ID: 10477
|
|
// Dependencies: [41, 42, 10443, 10439]
|
|
|
|
// Module 10476
|
|
import assignSimilarDate from "assignSimilarDate" /* 10443 */;
|
|
import closure_3 from "_classCallCheck" /* 41 */;
|
|
import _createClass from "_createClass" /* 42 */;
|
|
|
|
let self = this;
|
|
const ForwardDateRefiner = require;
|
|
let self2 = this;
|
|
if (this) {
|
|
self2 = self.__createBinding;
|
|
}
|
|
if (self2) {
|
|
let __setModuleDefault = self;
|
|
if (self) {
|
|
__setModuleDefault = self.__setModuleDefault;
|
|
}
|
|
if (__setModuleDefault) {
|
|
let fn = self;
|
|
if (self) {
|
|
fn = self.__importStar;
|
|
}
|
|
if (!fn) {
|
|
function t(arg0) {
|
|
let fn = Object.getOwnPropertyNames;
|
|
if (!fn) {
|
|
fn = (obj) => {
|
|
const items = [];
|
|
for (const key10005 in arg0) {
|
|
let tmp2 = key10005;
|
|
let _Object = Object;
|
|
let call = hasOwnProperty.call;
|
|
if (typeof call === "unknown") {
|
|
let hasOwnPropertyResult = hasOwnProperty(key10005);
|
|
} else {
|
|
hasOwnPropertyResult = call(arg0, key10005);
|
|
}
|
|
if (!hasOwnPropertyResult) {
|
|
continue;
|
|
} else {
|
|
items[items.length] = key10005;
|
|
continue;
|
|
}
|
|
continue;
|
|
}
|
|
return items;
|
|
};
|
|
}
|
|
return fn(arg0);
|
|
}
|
|
fn = (__esModule) => {
|
|
if (__esModule) {
|
|
if (__esModule.__esModule) {
|
|
return __esModule;
|
|
}
|
|
}
|
|
const obj = {};
|
|
if (null != __esModule) {
|
|
const arr = t(__esModule);
|
|
for (let num = 0; num < arr.length; num = num + 1) {
|
|
let tmp2 = num;
|
|
if ("default" !== arr[num]) {
|
|
let tmp3 = self2;
|
|
let tmp4 = self2(obj, __esModule, arr[num]);
|
|
}
|
|
}
|
|
}
|
|
__setModuleDefault(obj, __esModule);
|
|
return obj;
|
|
};
|
|
}
|
|
const _Object3 = Object;
|
|
let closure_6 = fn(assignSimilarDate);
|
|
class ForwardDateRefiner {
|
|
constructor() {
|
|
tmp = closure_3(this, ForwardDateRefiner);
|
|
return;
|
|
}
|
|
}
|
|
let obj = { key: "refine", value: null };
|
|
obj[1] = function refine(option, arr) {
|
|
const self = this;
|
|
closure_0 = option;
|
|
if (option.option.forwardDate) {
|
|
const item = arr.forEach((start) => {
|
|
option = start;
|
|
let obj = option;
|
|
const reference = option.reference;
|
|
const dateWithAdjustedTimezone = reference.getDateWithAdjustedTimezone();
|
|
start = start.start;
|
|
if (start.isOnlyTime()) {
|
|
const start2 = start.start;
|
|
if (obj.reference.instant > start2.date()) {
|
|
const reference2 = obj.reference;
|
|
const dateWithAdjustedTimezone1 = reference2.getDateWithAdjustedTimezone();
|
|
const _Date = Date;
|
|
const date = new Date(dateWithAdjustedTimezone1);
|
|
date.setDate(date.getDate() + 1);
|
|
closure_1_6.implySimilarDate(start.start, date);
|
|
obj.debug(() => {
|
|
console.log("" + dateWithAdjustedTimezone1.constructor.name + " adjusted " + closure_0 + " time from the ref date (" + dateWithAdjustedTimezone1 + ") to the following day (" + date + ")");
|
|
});
|
|
let end2 = start.end;
|
|
if (end2) {
|
|
const end = start.end;
|
|
end2 = end.isOnlyTime();
|
|
}
|
|
if (end2) {
|
|
obj8.implySimilarDate(start.end, date);
|
|
({ start: start3, end: end3 } = start);
|
|
if (dateResult > end3.date()) {
|
|
date.setDate(date.getDate() + 1);
|
|
obj8.implySimilarDate(start.end, date);
|
|
}
|
|
dateResult = start3.date();
|
|
}
|
|
}
|
|
}
|
|
const start4 = start.start;
|
|
let tmp5 = dateWithAdjustedTimezone;
|
|
if (start4.isOnlyWeekdayComponent()) {
|
|
const start5 = start.start;
|
|
tmp5 = dateWithAdjustedTimezone;
|
|
if (dateWithAdjustedTimezone > start5.date()) {
|
|
const start11 = start.start;
|
|
let value = start11.get("weekday");
|
|
const diff = value - dateWithAdjustedTimezone.getDay();
|
|
let sum = diff;
|
|
if (diff <= 0) {
|
|
sum = diff + 7;
|
|
}
|
|
obj = { day: null };
|
|
obj[0] = sum;
|
|
const addDurationResult = option(self[3]).addDuration(dateWithAdjustedTimezone, obj);
|
|
option(self[2]).implySimilarDate(start.start, addDurationResult);
|
|
obj.debug(() => {
|
|
console.log("" + dateWithAdjustedTimezone1.constructor.name + " adjusted " + start + " weekday (" + start.start + ")");
|
|
});
|
|
tmp5 = addDurationResult;
|
|
if (start.end) {
|
|
const end4 = start.end;
|
|
tmp5 = addDurationResult;
|
|
if (end4.isOnlyWeekdayComponent()) {
|
|
const end5 = start.end;
|
|
value = end5.get("weekday");
|
|
const diff1 = value - addDurationResult.getDay();
|
|
let sum1 = diff1;
|
|
if (diff1 <= 0) {
|
|
sum1 = diff1 + 7;
|
|
}
|
|
obj = { day: null };
|
|
obj[0] = sum1;
|
|
const addDurationResult1 = tmp7(tmp8[3]).addDuration(addDurationResult, obj);
|
|
tmp7(tmp8[2]).implySimilarDate(start.end, addDurationResult1);
|
|
obj.debug(() => {
|
|
console.log("" + dateWithAdjustedTimezone1.constructor.name + " adjusted " + start + " weekday (" + start.end + ")");
|
|
});
|
|
tmp5 = addDurationResult1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const start6 = start.start;
|
|
if (start6.isDateWithUnknownYear()) {
|
|
const start7 = start.start;
|
|
if (tmp5 > start7.date()) {
|
|
const start12 = start.start;
|
|
let num3 = 0;
|
|
if (tmp5 > start12.date()) {
|
|
while (true) {
|
|
({ start: start8, start: start9 } = start);
|
|
let implyResult = start8.imply("year", start9.get("year") + 1);
|
|
let obj6 = option;
|
|
let debugResult3 = option.debug(() => {
|
|
console.log("" + dateWithAdjustedTimezone1.constructor.name + " adjusted " + start + " year (" + start.start + ")");
|
|
});
|
|
let end6 = start.end;
|
|
let tmp19 = num3;
|
|
if (end6) {
|
|
let end7 = start.end;
|
|
end6 = !end7.isCertain("year");
|
|
}
|
|
if (end6) {
|
|
({ end: end8, end: end9 } = start);
|
|
let implyResult1 = end8.imply("year", end9.get("year") + 1);
|
|
let debugResult4 = obj6.debug(() => {
|
|
console.log("" + dateWithAdjustedTimezone1.constructor.name + " adjusted " + start + " month (" + start.start + ")");
|
|
});
|
|
}
|
|
let sum2 = num3 + 1;
|
|
if (sum2 >= 3) {
|
|
break;
|
|
} else {
|
|
let start10 = start.start;
|
|
num3 = sum2;
|
|
if (tmp5 <= start10.date()) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return arr;
|
|
};
|
|
let items = [obj];
|
|
exports.default = _createClass(ForwardDateRefiner, items);
|
|
} else {
|
|
const _Object2 = Object;
|
|
}
|
|
} else {
|
|
let _Object = Object;
|
|
}
|