-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZEE-2481: Time picker bases on system time ignoring time zone in user settings #893
EZEE-2481: Time picker bases on system time ignoring time zone in user settings #893
Conversation
As discussed with @SylvainGuittard and @supriyabhargava, eztime field should not have timezone. For all users, whatever timezone they have, it should show the same value. @SylvainGuittard mentioned "Default value: current time" option in ezdatetime in connected PR in different repository: https://github.com/ezsystems/date-based-publisher/pull/92
format has been changed: #893 (comment) |
@@ -91,13 +94,24 @@ | |||
const sourceInput = field.querySelector(SELECTOR_INPUT); | |||
const flatPickrInput = field.querySelector(SELECTOR_FLATPICKR_INPUT); | |||
const btnClear = field.querySelector('.ez-data-source__btn--clear-input'); | |||
const defaultDate = sourceInput.value ? new Date(sourceInput.value * 1000) : null; | |||
const secondsEnabled = sourceInput.dataset.seconds === '1'; | |||
const formatDate = secondsEnabled ? (date) => date.toLocaleString() : (date) => eZ.helpers.timezone.formatDate(date); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: As agreed with @SylvainGuittard, if seconds are enabled we fall back to date.toLocaleString()
because there it high probability that the date format from user settings does not include seconds. Otherwise we use the date format from user settings.
Changed to use only |
8b38ddb
to
556a7e6
Compare
WIP - during fixing - Behat tests fail. |
568557b
to
556a7e6
Compare
8e223ba
to
d43866b
Compare
Behat tests fixed by @mnocon 🙂 |
Could you merge it up? |
Merged up:
|
Checklist:
$ composer fix-cs
)