clashofclans.js 3.3.24-dev.4a30349 → 3.3.24-dev.8f08e9a
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/util/Util.d.ts +1 -1
- package/dist/util/Util.js +0 -10
- package/package.json +1 -1
package/dist/util/Util.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ export declare class Util extends null {
|
|
|
43
43
|
* @param {boolean} forward - Whether to forward to the next month if the returned date is in the past relative to the given timestamp. Defaults to true.
|
|
44
44
|
*/
|
|
45
45
|
static getSeason(timestamp?: Date, forward?: boolean): {
|
|
46
|
-
startTime: Date;
|
|
47
46
|
endTime: Date;
|
|
47
|
+
startTime: Date;
|
|
48
48
|
};
|
|
49
49
|
static allSettled<T>(values: Promise<T>[]): Promise<T[]>;
|
|
50
50
|
static delay(ms: number): Promise<unknown>;
|
package/dist/util/Util.js
CHANGED
|
@@ -96,9 +96,6 @@ class Util extends null {
|
|
|
96
96
|
return query.length ? `?${query}` : query;
|
|
97
97
|
}
|
|
98
98
|
static getSeasonStart(inputDate) {
|
|
99
|
-
if (inputDate >= new Date('2025-08-25T05:00:00.000Z') && inputDate <= new Date('2025-10-06T05:00:00.000Z')) {
|
|
100
|
-
return new Date('2025-08-25T05:00:00.000Z');
|
|
101
|
-
}
|
|
102
99
|
const lastMonthLastDay = new Date(Date.UTC(inputDate.getUTCFullYear(), inputDate.getUTCMonth(), 0));
|
|
103
100
|
const lastMonthLastMonday = new Date(lastMonthLastDay);
|
|
104
101
|
lastMonthLastMonday.setUTCDate(lastMonthLastMonday.getUTCDate() - ((lastMonthLastDay.getUTCDay() + 6) % 7));
|
|
@@ -106,9 +103,6 @@ class Util extends null {
|
|
|
106
103
|
return lastMonthLastMonday;
|
|
107
104
|
}
|
|
108
105
|
static getSeasonEnd(inputDate, forward = true) {
|
|
109
|
-
if (inputDate >= new Date('2025-08-25T05:00:00.000Z') && inputDate <= new Date('2025-10-06T05:00:00.000Z')) {
|
|
110
|
-
return forward ? new Date('2025-10-06T05:00:00.000Z') : new Date('2025-08-25T05:00:00.000Z');
|
|
111
|
-
}
|
|
112
106
|
const lastDayOfMonth = new Date(Date.UTC(inputDate.getUTCFullYear(), inputDate.getUTCMonth() + 1, 0));
|
|
113
107
|
const lastMonday = new Date(lastDayOfMonth);
|
|
114
108
|
lastMonday.setUTCDate(lastMonday.getUTCDate() - ((lastDayOfMonth.getUTCDay() + 6) % 7));
|
|
@@ -135,10 +129,6 @@ class Util extends null {
|
|
|
135
129
|
* @param {boolean} forward - Whether to forward to the next month if the returned date is in the past relative to the given timestamp. Defaults to true.
|
|
136
130
|
*/
|
|
137
131
|
static getSeason(timestamp, forward = true) {
|
|
138
|
-
const inputDate = timestamp ?? new Date();
|
|
139
|
-
if (inputDate >= new Date('2025-08-25T05:00:00.000Z') && inputDate <= new Date('2025-10-06T05:00:00.000Z')) {
|
|
140
|
-
return { startTime: new Date('2025-08-25T05:00:00.000Z'), endTime: new Date('2025-10-06T05:00:00.000Z') };
|
|
141
|
-
}
|
|
142
132
|
const endTime = this.getSeasonEnd(timestamp ?? new Date(), forward);
|
|
143
133
|
const startTime = this.getSeasonStart(endTime);
|
|
144
134
|
return { endTime, startTime };
|
package/package.json
CHANGED