Skip to content

Commit

Permalink
Default to current year instead of 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Nov 26, 2024
1 parent ef1dfa4 commit 4d6b961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function parse(str: string, tokens: FormatToken[], baseDate: Date | null)
let missingPunctuation = ''
let valid = true

baseDate = baseDate || new Date(2020, 0, 1, 0, 0, 0, 0)
baseDate = baseDate || new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)
let year = baseDate.getFullYear()
let month = baseDate.getMonth()
let day = baseDate.getDate()
Expand Down

0 comments on commit 4d6b961

Please sign in to comment.