Skip to content

Commit

Permalink
new test
Browse files Browse the repository at this point in the history
  • Loading branch information
FallBackITA27 committed Jun 20, 2024
1 parent 4192b1f commit e18d4e4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions mkwpp-parser/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,15 @@ document.getElementById("readInput").addEventListener("click", async function()
};
for (let keyword of keywords.slice(1, keywords.length)) {
let kw = keyword.replace(/,/g, "").replace(/th/g, "").replace(/rd/g, "").replace(/nd/g, "").replace(/st/g, "");
if (kw.length === 4) {
year = kw;
continue;
}
let _break = false;
for (let abbr of Object.keys(constants.months)) if (kw.startsWith(abbr)) {
console.log(kw);
month = constants.months[abbr];
_break = true;
break;
}
if (_break) continue;
if (kw.length === 4 && !isNaN(parseInt(kw))) {
year = kw;
continue;
}
date = kw.padStart(2,"0");
};
currentDate = `${year}-${month}-${date}`;
Expand Down

0 comments on commit e18d4e4

Please sign in to comment.