catchup-library-web 1.18.4 → 1.18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -4
- package/dist/index.mjs +12 -4
- package/package.json +1 -1
- package/src/utilization/DateUtilization.ts +13 -5
package/dist/index.d.mts
CHANGED
|
@@ -623,8 +623,8 @@ declare const retrieveDateIntervalOptionList: () => {
|
|
|
623
623
|
value: string;
|
|
624
624
|
text: string;
|
|
625
625
|
}[];
|
|
626
|
-
declare const calculateStartDateOfWeek: (date: Date) => Date;
|
|
627
|
-
declare const calculateEndDateOfWeek: (date: Date) => Date;
|
|
626
|
+
declare const calculateStartDateOfWeek: (date: Date, isGMT: boolean) => Date;
|
|
627
|
+
declare const calculateEndDateOfWeek: (date: Date, isGMT: boolean) => Date;
|
|
628
628
|
declare const adjustForTimezone: (date: Date) => Date;
|
|
629
629
|
declare const constructMonthName: (date: Date) => string;
|
|
630
630
|
declare const constructWeekName: (beginDate: Date, endDate: Date, untilSunday: boolean) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -623,8 +623,8 @@ declare const retrieveDateIntervalOptionList: () => {
|
|
|
623
623
|
value: string;
|
|
624
624
|
text: string;
|
|
625
625
|
}[];
|
|
626
|
-
declare const calculateStartDateOfWeek: (date: Date) => Date;
|
|
627
|
-
declare const calculateEndDateOfWeek: (date: Date) => Date;
|
|
626
|
+
declare const calculateStartDateOfWeek: (date: Date, isGMT: boolean) => Date;
|
|
627
|
+
declare const calculateEndDateOfWeek: (date: Date, isGMT: boolean) => Date;
|
|
628
628
|
declare const adjustForTimezone: (date: Date) => Date;
|
|
629
629
|
declare const constructMonthName: (date: Date) => string;
|
|
630
630
|
declare const constructWeekName: (beginDate: Date, endDate: Date, untilSunday: boolean) => string;
|
package/dist/index.js
CHANGED
|
@@ -9246,23 +9246,31 @@ var retrieveDateIntervalOptionList = () => {
|
|
|
9246
9246
|
}
|
|
9247
9247
|
];
|
|
9248
9248
|
};
|
|
9249
|
-
var calculateStartDateOfWeek = (date) => {
|
|
9249
|
+
var calculateStartDateOfWeek = (date, isGMT) => {
|
|
9250
9250
|
var diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1);
|
|
9251
9251
|
const startDate = new Date(date.setDate(diff));
|
|
9252
9252
|
startDate.setHours(0);
|
|
9253
9253
|
startDate.setMinutes(0);
|
|
9254
9254
|
startDate.setSeconds(0);
|
|
9255
9255
|
startDate.setMilliseconds(0);
|
|
9256
|
-
|
|
9256
|
+
if (isGMT) {
|
|
9257
|
+
return adjustForTimezone(startDate);
|
|
9258
|
+
} else {
|
|
9259
|
+
return startDate;
|
|
9260
|
+
}
|
|
9257
9261
|
};
|
|
9258
|
-
var calculateEndDateOfWeek = (date) => {
|
|
9262
|
+
var calculateEndDateOfWeek = (date, isGMT) => {
|
|
9259
9263
|
var lastday = date.getDate() - (date.getDay() - 1) + 6;
|
|
9260
9264
|
const endDate = new Date(date.setDate(lastday));
|
|
9261
9265
|
endDate.setHours(23);
|
|
9262
9266
|
endDate.setMinutes(59);
|
|
9263
9267
|
endDate.setSeconds(59);
|
|
9264
9268
|
endDate.setMilliseconds(999);
|
|
9265
|
-
|
|
9269
|
+
if (isGMT) {
|
|
9270
|
+
return adjustForTimezone(endDate);
|
|
9271
|
+
} else {
|
|
9272
|
+
return endDate;
|
|
9273
|
+
}
|
|
9266
9274
|
};
|
|
9267
9275
|
var adjustForTimezone = (date) => {
|
|
9268
9276
|
var timeOffsetInMS = date.getTimezoneOffset() * 6e4;
|
package/dist/index.mjs
CHANGED
|
@@ -9030,23 +9030,31 @@ var retrieveDateIntervalOptionList = () => {
|
|
|
9030
9030
|
}
|
|
9031
9031
|
];
|
|
9032
9032
|
};
|
|
9033
|
-
var calculateStartDateOfWeek = (date) => {
|
|
9033
|
+
var calculateStartDateOfWeek = (date, isGMT) => {
|
|
9034
9034
|
var diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1);
|
|
9035
9035
|
const startDate = new Date(date.setDate(diff));
|
|
9036
9036
|
startDate.setHours(0);
|
|
9037
9037
|
startDate.setMinutes(0);
|
|
9038
9038
|
startDate.setSeconds(0);
|
|
9039
9039
|
startDate.setMilliseconds(0);
|
|
9040
|
-
|
|
9040
|
+
if (isGMT) {
|
|
9041
|
+
return adjustForTimezone(startDate);
|
|
9042
|
+
} else {
|
|
9043
|
+
return startDate;
|
|
9044
|
+
}
|
|
9041
9045
|
};
|
|
9042
|
-
var calculateEndDateOfWeek = (date) => {
|
|
9046
|
+
var calculateEndDateOfWeek = (date, isGMT) => {
|
|
9043
9047
|
var lastday = date.getDate() - (date.getDay() - 1) + 6;
|
|
9044
9048
|
const endDate = new Date(date.setDate(lastday));
|
|
9045
9049
|
endDate.setHours(23);
|
|
9046
9050
|
endDate.setMinutes(59);
|
|
9047
9051
|
endDate.setSeconds(59);
|
|
9048
9052
|
endDate.setMilliseconds(999);
|
|
9049
|
-
|
|
9053
|
+
if (isGMT) {
|
|
9054
|
+
return adjustForTimezone(endDate);
|
|
9055
|
+
} else {
|
|
9056
|
+
return endDate;
|
|
9057
|
+
}
|
|
9050
9058
|
};
|
|
9051
9059
|
var adjustForTimezone = (date) => {
|
|
9052
9060
|
var timeOffsetInMS = date.getTimezoneOffset() * 6e4;
|
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ export const retrieveDateIntervalOptionList = () => {
|
|
|
55
55
|
];
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export const calculateStartDateOfWeek = (date: Date) => {
|
|
58
|
+
export const calculateStartDateOfWeek = (date: Date, isGMT: boolean) => {
|
|
59
59
|
var diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1);
|
|
60
60
|
|
|
61
61
|
const startDate = new Date(date.setDate(diff));
|
|
@@ -63,18 +63,26 @@ export const calculateStartDateOfWeek = (date: Date) => {
|
|
|
63
63
|
startDate.setMinutes(0);
|
|
64
64
|
startDate.setSeconds(0);
|
|
65
65
|
startDate.setMilliseconds(0);
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
if (isGMT) {
|
|
67
|
+
return adjustForTimezone(startDate);
|
|
68
|
+
} else {
|
|
69
|
+
return startDate;
|
|
70
|
+
}
|
|
68
71
|
};
|
|
69
72
|
|
|
70
|
-
export const calculateEndDateOfWeek = (date: Date) => {
|
|
73
|
+
export const calculateEndDateOfWeek = (date: Date, isGMT: boolean) => {
|
|
71
74
|
var lastday = date.getDate() - (date.getDay() - 1) + 6;
|
|
72
75
|
const endDate = new Date(date.setDate(lastday));
|
|
73
76
|
endDate.setHours(23);
|
|
74
77
|
endDate.setMinutes(59);
|
|
75
78
|
endDate.setSeconds(59);
|
|
76
79
|
endDate.setMilliseconds(999);
|
|
77
|
-
|
|
80
|
+
|
|
81
|
+
if (isGMT) {
|
|
82
|
+
return adjustForTimezone(endDate);
|
|
83
|
+
} else {
|
|
84
|
+
return endDate;
|
|
85
|
+
}
|
|
78
86
|
};
|
|
79
87
|
|
|
80
88
|
export const adjustForTimezone = (date: Date) => {
|