clashofclans.js 3.5.2-dev.50a7e99 → 3.5.3-dev.96712e2
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.js +3 -3
- package/dist/util.spec.js +0 -7
- package/package.json +1 -1
package/dist/util/Util.js
CHANGED
|
@@ -169,9 +169,9 @@ class Util extends null {
|
|
|
169
169
|
seasonId
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
const targetYear =
|
|
174
|
-
const targetMonth =
|
|
172
|
+
const date = new Date(seasonId);
|
|
173
|
+
const targetYear = date.getUTCFullYear();
|
|
174
|
+
const targetMonth = date.getUTCMonth() + 1; // 1..12
|
|
175
175
|
const referenceDate = new Date('2025-10-06T05:00:00.000Z');
|
|
176
176
|
// Only handle the post-6 Oct seasons with 28-day intervals
|
|
177
177
|
const refYear = referenceDate.getUTCFullYear();
|
package/dist/util.spec.js
CHANGED
|
@@ -86,7 +86,6 @@ describe('util', () => {
|
|
|
86
86
|
});
|
|
87
87
|
it('should pass Aug 2025 (seasonId)', async () => {
|
|
88
88
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2025-08');
|
|
89
|
-
console.log({ endTime, startTime, seasonId });
|
|
90
89
|
const expectedStartTime = new Date('2025-07-28T05:00').toISOString();
|
|
91
90
|
const expectedEndTime = new Date('2025-08-25T05:00').toISOString();
|
|
92
91
|
expect(startTime.toISOString()).toBe(expectedStartTime);
|
|
@@ -95,7 +94,6 @@ describe('util', () => {
|
|
|
95
94
|
});
|
|
96
95
|
it('should pass March 2024 (seasonId)', async () => {
|
|
97
96
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2024-03');
|
|
98
|
-
console.log({ endTime, startTime, seasonId });
|
|
99
97
|
const expectedEndTime = new Date('2024-03-25T05:00').toISOString();
|
|
100
98
|
const expectedStartTime = new Date('2024-02-26T05:00').toISOString();
|
|
101
99
|
expect(endTime.toISOString()).toBe(expectedEndTime);
|
|
@@ -104,7 +102,6 @@ describe('util', () => {
|
|
|
104
102
|
});
|
|
105
103
|
it('should pass Sep 2025 (seasonId)', async () => {
|
|
106
104
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2025-09');
|
|
107
|
-
console.log({ endTime, startTime, seasonId });
|
|
108
105
|
const expectedStartTime = new Date('2025-08-25T05:00').toISOString();
|
|
109
106
|
const expectedEndTime = new Date('2025-10-06T05:00').toISOString();
|
|
110
107
|
expect(startTime.toISOString()).toBe(expectedStartTime);
|
|
@@ -113,7 +110,6 @@ describe('util', () => {
|
|
|
113
110
|
});
|
|
114
111
|
it('should pass October 2025 (seasonId)', async () => {
|
|
115
112
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2025-10');
|
|
116
|
-
console.log({ endTime, startTime, seasonId });
|
|
117
113
|
const expectedStartTime = new Date('2025-10-06T05:00').toISOString();
|
|
118
114
|
const expectedEndTime = new Date('2025-11-03T05:00').toISOString();
|
|
119
115
|
expect(startTime.toISOString()).toBe(expectedStartTime);
|
|
@@ -122,7 +118,6 @@ describe('util', () => {
|
|
|
122
118
|
});
|
|
123
119
|
it('should pass Dec 2025 (seasonId)', async () => {
|
|
124
120
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2025-12');
|
|
125
|
-
console.log({ endTime, startTime, seasonId });
|
|
126
121
|
const expectedStartTime = new Date('2025-12-01T05:00').toISOString();
|
|
127
122
|
const expectedEndTime = new Date('2025-12-29T05:00').toISOString();
|
|
128
123
|
expect(startTime.toISOString()).toBe(expectedStartTime);
|
|
@@ -131,7 +126,6 @@ describe('util', () => {
|
|
|
131
126
|
});
|
|
132
127
|
it('should pass Jan 2026 (seasonId)', async () => {
|
|
133
128
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2026-01');
|
|
134
|
-
console.log({ endTime, startTime, seasonId });
|
|
135
129
|
const expectedStartTime = new Date('2025-12-29T05:00').toISOString();
|
|
136
130
|
const expectedEndTime = new Date('2026-01-26T05:00').toISOString();
|
|
137
131
|
expect(startTime.toISOString()).toBe(expectedStartTime);
|
|
@@ -140,7 +134,6 @@ describe('util', () => {
|
|
|
140
134
|
});
|
|
141
135
|
it('should pass Feb 2026 (seasonId)', async () => {
|
|
142
136
|
const { endTime, startTime, seasonId } = Util_1.Util.getSeasonById('2026-02');
|
|
143
|
-
console.log({ endTime, startTime, seasonId });
|
|
144
137
|
const expectedStartTime = new Date('2026-01-26T05:00').toISOString();
|
|
145
138
|
const expectedEndTime = new Date('2026-02-23T05:00').toISOString();
|
|
146
139
|
expect(startTime.toISOString()).toBe(expectedStartTime);
|
package/package.json
CHANGED