Steps to reproduce:
- Create ContentType with ezdatetime fieldtype - set default time as the current time.
- Set browser timezone to timezone which has a previous or next day after your current day (i.e. by using https://webbrowsertools.com/timezone/extension).
- Set PHP timezone to different values.
- Create Content within newly created ContentType - observe invalid values in the input field and in flatPickr widget during draft creation.
- Publish Content.
- Edit this Content - observe different values in input field than values you have set in the previous step and weird flatPickr behavior.
- Play with timezone settings to observe different scenarios of the steps #4 and #6.
1. The date in the input field has an invalid default datetime when creating new Content.
2. The date in the input field has an invalid datetime when editing this Content.
The datetime in the input field has a valid value in both cases.
- In case of showing the default datetime when creating new Content - it should be just the user's current time (the browser's time) - PHP time should not affect this time as the user could be in the different timezone than a server - so showing him "his time" should be a way to go.
- This can be really tricky to test, so using different PHP and browser's timezone setups should be taken in consideration.