There are some inconsistencies in values displayed by DateandTime Field Types when using Legacy Bridge, between frontoffice and the backoffice and the legacy stack and the new stack. Or when having data from legacy (migration/upgrade).
There are also issues in eZ Platform itself here overlapping with this covered in EZP-29136.
Steps to reproduce
- Create new eZ Platform installation with Legacy Bridge. I have date.timezone setting in php.ini set to "Europe/Warsaw" and have the browser's timezone set analogically (this affects the results below, meaning that the displayed values might be different if using different timezones).
- In the app/config/ezplatform.yml, add the following configuration:
- Create file src/AppBundle/Resources/views/pagelayout.html.twig with the following content:
- Create a Content Type with a Date and DateAndTime Field Definitions. Put 'date' and 'date_and_time' as their identifiers, respectively.
- In the Legacy backoffice, create a Content Object of this Content Type, giving it a date value in one field (for example "01/06/2018") and date and time value in other field (for example "01/06/2018 12:00 pm").
- Check the values displayed for this Content Object:
- In the Legacy backoffice, navigate to this Content Object. You should see its fields values displayed correctly:
- In the Platform UI, navigate to this Content Object. You should see the following values (note the wrong value for Date Field Type):
- In the frontoffice, navigate to this Content Object. If you display it using Legacy stack ("The legacy generated content"), you will see the following values (correct):
- If you display the same Content Object using ez_render_field ("The new stack generated content"), you will see the following values (note the wrong value for Date Field Type):
- Now, after I change date.timezone setting in php.ini set to "America/Puerto_Rico" (without republishing the Content), I have the following results:
- In the Legacy backoffice values are displayed like the following (the same as before):
- In the Platform UI nothing changes (value for Date Field Type is still wrong):
- In the frontoffice, using the Legacy stack, the values are the following (also the same as before):
- In the frontoffice, using the new stack, both values are different (the Date Field Type by 2 days, while Date and time by 6 hours):