Changed the default date and min date for the Tempus Dominus month chooser from strings to the JavaScript Date objects.

This commit is contained in:
依瑪貓 2023-03-19 10:15:32 +08:00
parent 4977847dd8
commit 122b7b059c

View File

@ -175,7 +175,7 @@ class MonthTab extends TabPlane {
let start = monthChooser.dataset.start;
this.#monthChooser = new tempusDominus.TempusDominus(monthChooser, {
restrictions: {
minDate: start,
minDate: new Date(start),
},
display: {
inline: true,
@ -184,7 +184,7 @@ class MonthTab extends TabPlane {
clock: false,
},
},
defaultDate: monthChooser.dataset.default,
defaultDate: new Date(monthChooser.dataset.default),
});
monthChooser.addEventListener(tempusDominus.Namespace.events.change, (e) => {
const date = e.detail.date;