Skip to content

Commit

Permalink
Parse date parts as integers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mxie committed Aug 10, 2021
1 parent 5b13f10 commit 491c542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function run() {
const results = datePattern.exec(issueTitle);

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

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

0 comments on commit 491c542

Please sign in to comment.