Skip to content

Commit

Permalink
IBX-9457 Hide time selection in Day attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
bozatko committed Feb 24, 2025
1 parent 0714559 commit db26490
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/bundle/Resources/public/js/scripts/admin.picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
const pickers = doc.querySelectorAll(SELECTOR_PICKER);
const { formatShortDateTime, convertDateToTimezone, getBrowserTimezone } = ibexa.helpers.timezone;
const userTimezone = ibexa.adminUiConfig.timezone;
const pickerConfig = {
enableTime: true,
time_24hr: true,
formatDate: (date) => formatShortDateTime(date, null),
};
const updateInputValue = (formInput, timestamp) => {
if (timestamp !== formInput.value) {
formInput.value = timestamp ?? '';
Expand All @@ -21,7 +16,13 @@
const formInput = field.querySelector(SELECTOR_FORM_INPUT);
const pickerInput = field.querySelector(SELECTOR_PICKER_INPUT);
const customConfig = JSON.parse(pickerInput.dataset.flatpickrConfig || '{}');
const enableTime = formInput.dataset.seconds !== undefined;
const enableSeconds = formInput.dataset.seconds === '1';
const pickerConfig = {
enableTime,
time_24hr: true,
formatDate: (date) => formatShortDateTime(date, null),
};
let defaultDate;

if (formInput.value) {
Expand All @@ -39,7 +40,7 @@
flatpickrConfig: {
...pickerConfig,
defaultDate,
enableSeconds,
...(enableTime && { enableSeconds }),
...customConfig,
},
});
Expand Down

0 comments on commit db26490

Please sign in to comment.