diff --git a/src/bundle/Resources/public/js/scripts/admin.picker.js b/src/bundle/Resources/public/js/scripts/admin.picker.js index 04ecbfbda6..4bfe2ba340 100644 --- a/src/bundle/Resources/public/js/scripts/admin.picker.js +++ b/src/bundle/Resources/public/js/scripts/admin.picker.js @@ -3,7 +3,7 @@ const SELECTOR_PICKER_INPUT = '.ibexa-date-time-picker__input'; const SELECTOR_FORM_INPUT = '.ibexa-picker__form-input'; const pickers = doc.querySelectorAll(SELECTOR_PICKER); - const { formatShortDateTime, convertDateToTimezone, guessUserTimezone } = ibexa.helpers.timezone; + const { formatShortDateTime, convertDateToTimezone, browserTimezone } = ibexa.helpers.timezone; const userTimezone = ibexa.adminUiConfig.timezone; const pickerConfig = { enableTime: true, @@ -26,7 +26,7 @@ if (formInput.value) { const date = new Date(formInput.value * 1000); const dateWithUserTimezone = convertDateToTimezone(date, userTimezone); - const localTimezone = guessUserTimezone(); + const localTimezone = browserTimezone(); const convertedDate = convertDateToTimezone(dateWithUserTimezone, localTimezone, true).format(); defaultDate = convertedDate; diff --git a/src/bundle/Resources/public/js/scripts/helpers/timezone.helper.js b/src/bundle/Resources/public/js/scripts/helpers/timezone.helper.js index eda3bf6602..5d03cce2cd 100644 --- a/src/bundle/Resources/public/js/scripts/helpers/timezone.helper.js +++ b/src/bundle/Resources/public/js/scripts/helpers/timezone.helper.js @@ -19,7 +19,7 @@ const formatShortDateTime = (date, timezone = userPreferredTimezone, format = userPreferredShortDateTimeFormat) => { return formatDate(date, timezone, format); }; - const guessUserTimezone = () => { + const browserTimezone = () => { return Intl.DateTimeFormat().resolvedOptions().timeZone; }; @@ -27,6 +27,6 @@ convertDateToTimezone, formatFullDateTime, formatShortDateTime, - guessUserTimezone, + browserTimezone, }); })(window, window.document, window.ibexa, window.moment);