#5303 - CPF and catalogue date and date_time fields do not handle time zones properly
| Identifier | #5303 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | CPF and catalogue date and date_time fields do not handle time zones properly |
| Status | Completed |
| Tags |
Roadmap: v11 (custom) |
| Handling member | PDStig |
| Version | 11 beta3 |
| Addon | core_fields |
| Description | A CPF date field on a profile with a filled in date will keep rolling back by 1 day each time the profile is saved.
Might be a timezone issue / might be happening when the timezone is < GMT. |
| Steps to reproduce | |
| Funded? | No |
| Commits |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
The date and date_time fields used in CPFs and in catalogues did not properly handle time zones. This resulted in some weird conversions and changes to the values when going in to edit an entry (or a profile).
This hotfix applies the following changes:
* The date field no longer respects time zones (we can't because dates are always midnight which causes some weird behaviour)
* The date_time field is now the only date-based field that respects time zones; this is indicated when selecting a field type.
* The date_time field will take input in the user's time zone, save as UTC in the database, and render as whichever time zone the viewer is in.