Skip to content

Commit 4d6b961

Browse files
Default to current year instead of 2020
1 parent ef1dfa4 commit 4d6b961

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function parse(str: string, tokens: FormatToken[], baseDate: Date | null)
1919
let missingPunctuation = ''
2020
let valid = true
2121

22-
baseDate = baseDate || new Date(2020, 0, 1, 0, 0, 0, 0)
22+
baseDate = baseDate || new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)
2323
let year = baseDate.getFullYear()
2424
let month = baseDate.getMonth()
2525
let day = baseDate.getDate()

0 commit comments

Comments
 (0)