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 server time zone #2422

Merged

Conversation

jacek-foremski
Copy link
Contributor

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

Question Answer
JIRA issue EZP-29279
Bug/Improvement yes
New feature no
Target version 6.7
BC breaks minor
Tests pass yes
Doc needed no

Currently, the value for Date Field Type displayed in the front office is affected by the server's timezone, meaning that if the server has timezone below (west of) UTC, then the previous day is displayed.
The value stored in the database is always midnight in UTC.
Twig by default applies the server's timezone when using its localizeddate method, so in this PR I fix the issue by making sure it doesn't.

The minor BC break that I mentioned is that someone could rely on the wrong behavior (but they really shouldn't).

TODO:

  • Implement feature / fix a bug.
  • Implement tests (skipped).
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply to other date/time-related fields?

@crevillo
Copy link
Contributor

adding to @alongosz's question, shouldn't we do the same for ezdatetime block in the same field?

@jacek-foremski
Copy link
Contributor Author

It probably also affects other Field Types, although I started with Date Field Type to make it display correctly in all versions of eZ (other related PRs: ezsystems/PlatformUIBundle#984, ezsystems/ezplatform-admin-ui#598, ezsystems/ezpublish-legacy#1384). Next step would be to do the same for other Field Types (Time and Datetime).

@crevillo
Copy link
Contributor

👍

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