Revised the JavaScript MonthTab class in the period chooser to avoid nested template literals, for readability.
This commit is contained in:
parent
f7efacad75
commit
8286c0c6d8
@ -181,7 +181,8 @@ class MonthTab extends TabPlane {
|
|||||||
});
|
});
|
||||||
monthChooser.addEventListener(tempusDominus.Namespace.events.change, (e) => {
|
monthChooser.addEventListener(tempusDominus.Namespace.events.change, (e) => {
|
||||||
const date = e.detail.date;
|
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
|
window.location = chooser.modal.dataset.urlTemplate
|
||||||
.replaceAll("PERIOD", period);
|
.replaceAll("PERIOD", period);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user