Skip to content

Commit 491c542

Browse files
authored
Parse date parts as integers
So that we can actually perform math. For some reason, JavaScript allowed "6" - 1 to equal 5 and so the `new Date` call just worked previously.
1 parent 5b13f10 commit 491c542

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function run() {
2525
const results = datePattern.exec(issueTitle);
2626

2727
if (results !== null) {
28-
let [month, day, year] = results.slice(1);
28+
let [month, day, year] = results.slice(1).map((part) => parseInt(part, 10));
2929

3030
// if the year is under 100, assume it's from the 2000s
3131
if (year < 100) {

0 commit comments

Comments
 (0)