diff --git a/src/accounting/static/js/period-chooser.js b/src/accounting/static/js/period-chooser.js index 0bdfcce..4224819 100644 --- a/src/accounting/static/js/period-chooser.js +++ b/src/accounting/static/js/period-chooser.js @@ -181,7 +181,8 @@ class MonthTab extends TabPlane { }); monthChooser.addEventListener(tempusDominus.Namespace.events.change, (e) => { const date = e.detail.date; - const period = `${date.year}-${`0${date.month + 1}`.slice(-2)}`; + const zeroPaddedMonth = `0${date.month + 1}`.slice(-2) + const period = `${date.year}-${zeroPaddedMonth}`; window.location = chooser.modal.dataset.urlTemplate .replaceAll("PERIOD", period); });