diff --git a/frontend/src/utils/form/datepicker.js b/frontend/src/utils/form/datepicker.js index 22b94ab79..dbf0b1348 100644 --- a/frontend/src/utils/form/datepicker.js +++ b/frontend/src/utils/form/datepicker.js @@ -10,18 +10,37 @@ const DATEPICKER_INITIALIZED_CLASS = 'datepicker--initialized'; const DATEPICKER_CONFIG = { 'global': { + // minimize overlaps with other date inputs position: 'right', - locale: 'de', // TODO: hardcoded - weekStart: 1, // TODO: hardcoded - stayOpen: true, // to prevent the instance from closing when selecting a date before selecting a time + + // set default time to 00:00:00 + // this is a workaround to prevent inconsistent dates in input field and datepicker + timeHours: 0, + timeMinutes: 0, + timeSeconds: 0, + + // german settings + // TODO: hardcoded, get from current language / settings + locale: 'de', + weekStart: 1, + dateFormat: 'dd.mm.YYYY', + + // prevent the instance from closing when selecting a date before selecting a time + stayOpen: true, + + // hide the close button (we handle closing the datepicker manually by clicking outside) closeButton: false, - dateFormat: 'dd.mm.YYYY', // TODO: hardcoded, get from setting + + // disable the decades view because nobody will ever need it (i.e. cap the switch to the more relevant year view) + viewDecades: false, }, 'datetime-local': {}, 'date': { + // disable date picker timeFormat: false, }, 'time': { + // disable time picker dateFormat: false, }, };