From 122b7b059cdb92d4b95ad114903fb752d2de92fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 19 Mar 2023 10:15:32 +0800 Subject: [PATCH] Changed the default date and min date for the Tempus Dominus month chooser from strings to the JavaScript Date objects. --- src/accounting/static/js/period-chooser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accounting/static/js/period-chooser.js b/src/accounting/static/js/period-chooser.js index 6014f2a..be0a71d 100644 --- a/src/accounting/static/js/period-chooser.js +++ b/src/accounting/static/js/period-chooser.js @@ -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;