Update timepicker restrictions and add a minimum date

- Update timepicker options to display inline and side by side
- Remove the previous restriction on minimum date
- Add a new restriction for maximum date
- Add a new restriction for minimum date, set to current date
This commit is contained in:
Jeroen De Meerleer 2023-09-11 08:17:54 +02:00
parent f42530ea46
commit e7fc6f707b
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 2 additions and 4 deletions

View File

@ -38,9 +38,6 @@ function initTimepicker() {
datepickeroptions = Utils.timepickerOptions; datepickeroptions = Utils.timepickerOptions;
datepickeroptions.display.inline = true; datepickeroptions.display.inline = true;
datepickeroptions.display.sideBySide = true; datepickeroptions.display.sideBySide = true;
datepickeroptions.restrictions = {
minDate: new Date()
};
selecttimedatepicker = new TempusDominus(document.querySelector('#selecttime_datepicker'), datepickeroptions); selecttimedatepicker = new TempusDominus(document.querySelector('#selecttime_datepicker'), datepickeroptions);
} }
function initRunButtons() { function initRunButtons() {
@ -62,7 +59,8 @@ function initRunButtons() {
} }
selecttimedatepicker.updateOptions({ selecttimedatepicker.updateOptions({
restrictions: { restrictions: {
maxDate: maxdate maxDate: maxdate,
minDate: new Date()
} }
}) })