Skip to content
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

EZP-29279: Fix value displayed by the Date Field Type being affected by browser time zone #598

Merged

Conversation

jacek-foremski
Copy link
Contributor

@jacek-foremski jacek-foremski commented Aug 16, 2018

Question Answer
Tickets EZP-29279
Bug fix? yes
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Currently the value for Date Field Type displayed in the backoffice (in edit mode) is affected by the browser's timezone, meaning that if the browser has timezone below (west of) UTC, then the previous day is displayed.
Value stored in the database is always midnight in UTC.
Javascript automatically uses the browser's timezone when handling Date objects, so in this PR I fix the issue by manually adding the offset before passing the Date object to flatpickr library.

Similar to ezsystems/PlatformUIBundle#984.

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@micszo micszo self-assigned this Sep 4, 2018
@micszo micszo removed their assignment Oct 17, 2018
@andrerom
Copy link
Contributor

@lserwatka All other PR's on this bug fix has been merged, so I think this should too.

@lserwatka
Copy link
Member

@tischsoic is this still valid, given you worked on dates recently?

@tischsoic
Copy link
Contributor

@lserwatka I checked it and problem still does occur.

@lserwatka
Copy link
Member

@micszo could we have a round of QA here so we can include this fix?

@micszo
Copy link
Member

micszo commented Mar 14, 2019

Retested on v2.2.3 with diff.

@lserwatka lserwatka merged commit 82d5a39 into ezsystems:1.2 Mar 14, 2019
@lserwatka
Copy link
Member

@tischsoic could you help merge this up to 1.3/1.4 and master?

@tischsoic
Copy link
Contributor

tischsoic commented Mar 14, 2019

@lserwatka PR merged up:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

7 participants