Skip to content

Commit 2722e1b

Browse files
authored
fix(calendar): calendar breaks when initialDate is string
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)
1 parent dbc8d11 commit 2722e1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/definitions/modules/calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
today = new Date(),
256256
date = module.get.date(),
257257
focusDate = module.get.focusDate(),
258-
display = module.helper.dateInRange(focusDate || date || settings.initialDate || today)
258+
display = module.helper.dateInRange(focusDate || date || parser.date(settings.initialDate, settings) || today)
259259
;
260260

261261
if (!focusDate) {

0 commit comments

Comments
 (0)