Skip to content

Commit ed527a4

Browse files
committed
fix(update-browser-releases): support full month names
1 parent 6f36940 commit ed527a4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

scripts/update-browser-releases/edge.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,11 @@ describe('parseReleaseDate', () => {
1212
assert.equal(result.getUTCMonth(), 2); // March is 0-indexed as 2
1313
assert.equal(result.getUTCDate(), 12);
1414
});
15+
16+
it('should parse date with full month correctly', () => {
17+
const result = parseReleaseDate('09-April-2026');
18+
assert.equal(result.getUTCFullYear(), 2026);
19+
assert.equal(result.getUTCMonth(), 3); // April is 0-indexed as 3
20+
assert.equal(result.getUTCDate(), 9);
21+
});
1522
});

scripts/update-browser-releases/edge.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,8 @@ export const parseReleaseDate = (dateText: string) => {
331331
'Nov',
332332
'Dec',
333333
];
334-
const year = dateText.substring(7, 11);
335-
const month = months.indexOf(dateText.substring(3, 6)) + 1;
336-
const day = dateText.substring(0, 2);
334+
const [day, monthText, year] = dateText.split('-');
335+
const month = months.findIndex((m) => monthText.startsWith(m)) + 1;
337336

338337
return new Date(`${year}-${month}-${day}Z`);
339338
};

0 commit comments

Comments
 (0)