From e7fc6f707bbe9ab8ff3e0d5345a90b18e30109e0 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 11 Sep 2023 08:17:54 +0200 Subject: [PATCH] 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 --- assets/js/job/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/assets/js/job/index.js b/assets/js/job/index.js index 2f7b52e..951d2e5 100644 --- a/assets/js/job/index.js +++ b/assets/js/job/index.js @@ -38,9 +38,6 @@ function initTimepicker() { datepickeroptions = Utils.timepickerOptions; datepickeroptions.display.inline = true; datepickeroptions.display.sideBySide = true; - datepickeroptions.restrictions = { - minDate: new Date() - }; selecttimedatepicker = new TempusDominus(document.querySelector('#selecttime_datepicker'), datepickeroptions); } function initRunButtons() { @@ -62,7 +59,8 @@ function initRunButtons() { } selecttimedatepicker.updateOptions({ restrictions: { - maxDate: maxdate + maxDate: maxdate, + minDate: new Date() } })