catchup-library-web 1.20.20 → 1.20.21
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.js +5 -6
- package/dist/index.mjs +5 -6
- package/package.json +1 -1
- package/src/utilization/DateUtilization.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -9215,12 +9215,11 @@ var calculateStartDateOfWeek = (date, isGMT) => {
|
|
|
9215
9215
|
}
|
|
9216
9216
|
};
|
|
9217
9217
|
var calculateEndDateOfWeek = (date, isGMT) => {
|
|
9218
|
-
|
|
9219
|
-
const
|
|
9220
|
-
endDate
|
|
9221
|
-
endDate.
|
|
9222
|
-
endDate.
|
|
9223
|
-
endDate.setMilliseconds(999);
|
|
9218
|
+
const dayOfWeek = date.getDay();
|
|
9219
|
+
const daysUntilSunday = (7 - dayOfWeek) % 7;
|
|
9220
|
+
const endDate = new Date(date);
|
|
9221
|
+
endDate.setDate(date.getDate() + daysUntilSunday);
|
|
9222
|
+
endDate.setHours(23, 59, 59, 999);
|
|
9224
9223
|
if (isGMT) {
|
|
9225
9224
|
return adjustForTimezone(endDate);
|
|
9226
9225
|
} else {
|
package/dist/index.mjs
CHANGED
|
@@ -8999,12 +8999,11 @@ var calculateStartDateOfWeek = (date, isGMT) => {
|
|
|
8999
8999
|
}
|
|
9000
9000
|
};
|
|
9001
9001
|
var calculateEndDateOfWeek = (date, isGMT) => {
|
|
9002
|
-
|
|
9003
|
-
const
|
|
9004
|
-
endDate
|
|
9005
|
-
endDate.
|
|
9006
|
-
endDate.
|
|
9007
|
-
endDate.setMilliseconds(999);
|
|
9002
|
+
const dayOfWeek = date.getDay();
|
|
9003
|
+
const daysUntilSunday = (7 - dayOfWeek) % 7;
|
|
9004
|
+
const endDate = new Date(date);
|
|
9005
|
+
endDate.setDate(date.getDate() + daysUntilSunday);
|
|
9006
|
+
endDate.setHours(23, 59, 59, 999);
|
|
9008
9007
|
if (isGMT) {
|
|
9009
9008
|
return adjustForTimezone(endDate);
|
|
9010
9009
|
} else {
|
package/package.json
CHANGED
|
@@ -71,12 +71,12 @@ export const calculateStartDateOfWeek = (date: Date, isGMT: boolean) => {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export const calculateEndDateOfWeek = (date: Date, isGMT: boolean) => {
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
endDate
|
|
78
|
-
endDate.
|
|
79
|
-
endDate.
|
|
74
|
+
const dayOfWeek = date.getDay();
|
|
75
|
+
const daysUntilSunday = (7 - dayOfWeek) % 7;
|
|
76
|
+
|
|
77
|
+
const endDate = new Date(date);
|
|
78
|
+
endDate.setDate(date.getDate() + daysUntilSunday);
|
|
79
|
+
endDate.setHours(23, 59, 59, 999);
|
|
80
80
|
|
|
81
81
|
if (isGMT) {
|
|
82
82
|
return adjustForTimezone(endDate);
|