From c04c08bca4064ac706a155397b26b523c2e6e74a Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 16 May 2025 08:22:19 +0200 Subject: [PATCH] finetune datepicker and timepicker config --- .../js/components/Cis/Raumsuche/Raumsuche.js | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/public/js/components/Cis/Raumsuche/Raumsuche.js b/public/js/components/Cis/Raumsuche/Raumsuche.js index a279fb1c0..20685fa09 100644 --- a/public/js/components/Cis/Raumsuche/Raumsuche.js +++ b/public/js/components/Cis/Raumsuche/Raumsuche.js @@ -31,6 +31,20 @@ export const Raumsuche = { hours: new Date().getHours() + 1, minutes: new Date().getMinutes() }), + datepickerTextInputOptions: { + enterSubmit: true, + tabSubmit: true, + selectOnFocus: true, + format: 'dd.MM.yyyy', + escClose: true + }, + timepickerTextInputOptions: { + enterSubmit: true, + tabSubmit: true, + selectOnFocus: true, + format: 'HH:mm', + escClose: true + }, raumsucheTableOptions: { height: Vue.ref(400), index: 'ort_kurzbz', @@ -135,8 +149,8 @@ export const Raumsuche = { // TODO: router push }, dateFormat(date) { - const day = date.getDate(); - const month = date.getMonth() + 1; + const day = String(date.getDate()).padStart(2, '0'); + const month = String(date.getMonth() + 1).padStart(2, '0'); const year = date.getFullYear(); return `${day}.${month}.${year}` }, @@ -187,7 +201,8 @@ export const Raumsuche = { date-picker :enable-time-picker="false" :format="dateFormat" - :text-input="true" + :text-input="datepickerTextInputOptions" + :min-date="new Date()" auto-apply> @@ -197,7 +212,8 @@ export const Raumsuche = { :clearable="false" time-picker :format="timeFormat" - :text-input="true" + :text-input="timepickerTextInputOptions" + :is-24="true" auto-apply > @@ -208,7 +224,8 @@ export const Raumsuche = { :clearable="false" time-picker :format="timeFormat" - :text-input="true" + :text-input="timepickerTextInputOptions" + :is-24="true" auto-apply>