Skip to content

Commit

Permalink
fix(calendar): calendar breaks when initialDate is string
Browse files Browse the repository at this point in the history
Whenever a given initialDate is made out of a string, a possible later ' clean' breaks the calendar refresh by console error.
That's because the initialDate is taken as a month reference when no date is given (via clear), but it was forgotten to parse the initialDate beforehand (was working fine as long as it's a JS Date object already)
  • Loading branch information
lubber-de authored Dec 10, 2022
1 parent dbc8d11 commit 2722e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
today = new Date(),
date = module.get.date(),
focusDate = module.get.focusDate(),
display = module.helper.dateInRange(focusDate || date || settings.initialDate || today)
display = module.helper.dateInRange(focusDate || date || parser.date(settings.initialDate, settings) || today)
;

if (!focusDate) {
Expand Down

0 comments on commit 2722e1b

Please sign in to comment.