Skip to content

[6.x] Fix date-only formats shifting days due to timezone conversion#14552

Open
duncanmcclean wants to merge 1 commit into6.xfrom
dates-without-times
Open

[6.x] Fix date-only formats shifting days due to timezone conversion#14552
duncanmcclean wants to merge 1 commit into6.xfrom
dates-without-times

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

@duncanmcclean duncanmcclean commented Apr 27, 2026

This pull request fixes an issue where date fields with formats that don't contain time (e.g. Y-m-d) would shift days depending on the user's browser timezone.

For example: a user in Amsterdam selecting 2026-12-25 would actually save as 2026-12-24 due to negative UTC offsets.

This was happening because all dates — including date-only values — were being converted to UTC, then localized into the browser's timezone.

For a date like 2026-12-25 stored with format Y-m-d, the value would be interpreted as 2026-12-25T00:00:00 in the app timezone, converted to a Zulu string, then localized to the browser's timezone, potentially shifting the day.

This PR fixes it by bypassing timezone conversion entirely when the save format doesn't contain time characters. Date-only values now flow as plain Y-m-d strings between the backend and frontend, using CalendarDate objects that carry no timezone information.

Fixes #14413

Date fields with formats that don't contain time (e.g. Y-m-d) were being
unnecessarily converted through UTC, causing days to shift depending on
the user's browser timezone. A date like 2024-12-25 could appear as
December 24th for users in negative UTC offsets.

Date-only formats now bypass timezone conversion entirely, flowing as
plain Y-m-d strings between backend and frontend using CalendarDate
objects that have no timezone information.

Fixes #14413

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date-only fields show wrong date in CP collection table for timezones ahead of UTC

1 participant