Skip to content

Commit

Permalink
IBX-3534: Date picker seconds configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bozatko committed Dec 18, 2024
1 parent 4ae54ca commit bd59e01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/admin.picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
const formInput = field.querySelector(SELECTOR_FORM_INPUT);
const pickerInput = field.querySelector(SELECTOR_PICKER_INPUT);
const customConfig = JSON.parse(pickerInput.dataset.flatpickrConfig || '{}');
const sourceInput = field.querySelector(`${SELECTOR_FORM_INPUT}[data-seconds]`);
const secondsEnabled = sourceInput ? sourceInput.dataset.seconds === '1' : false;
let defaultDate;

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

0 comments on commit bd59e01

Please sign in to comment.