Skip to content

Commit

Permalink
Minor fix in yearString condition
Browse files Browse the repository at this point in the history
  • Loading branch information
skpanagiotis committed Jan 19, 2025
1 parent 94d069b commit 7b763c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isISO8601.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const isValidDate = (str) => {
const day = match[3];
const monthString = month ? `${month}`.padStart(2, '0') : month;
const dayString = day ? `${day}`.padStart(2, '0') : day;
const yearString = year < 100 ? `${year}`.padStart(4, '0') : year;
const yearString = year < 1000 ? `${year}`.padStart(4, '0') : year;

// create a date object and compare
const d = new Date(`${yearString}-${monthString || '01'}-${dayString || '01'}`);
Expand Down

0 comments on commit 7b763c9

Please sign in to comment.