fix: date-only column display shifted one day behind in non-UTC timezones - #2882
Open
tareko wants to merge 1 commit into
Open
fix: date-only column display shifted one day behind in non-UTC timezones#2882tareko wants to merge 1 commit into
tareko wants to merge 1 commit into
Conversation
…ones
The formatValue method for datetime-date columns parsed date-only values
(e.g. "2025-08-25") using the datetime format 'YYYY-MM-DD HH:mm:ss'.
Since the input doesn't match the format, Moment.js falls back to ISO 8601
parsing, which interprets date-only strings as UTC midnight. When
.format('ll') then converts to the user's local timezone, the date shifts
back one day for users behind UTC (e.g. America/Toronto UTC-4).
Fix: use 'YYYY-MM-DD' as the Moment parse format, which matches the actual
value and ensures local-timezone parsing. This is consistent with
getDateFormat() in TableCellDateTime.vue, which already uses 'YYYY-MM-DD'
for the edit mode (and editing correctly showed the right date).
Fixes nextcloud#2705
Signed-off-by: Tarek <shopping@tarek.org>
Assisted-by: GLM:5.2
tareko
force-pushed
the
fix/date-display-timezone-shift
branch
from
August 9, 2026 10:43
3588be0 to
8be57c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
The discovery of this bug and code to fix it were assisted by AI: GLM 5.2
Date-only columns display the date one day behind the entered value for users in timezones behind UTC (e.g. America/Toronto UTC-4).
Steps to reproduce:
Root cause
In
datetimeDate.js,formatValueparsed date-only values (e.g."2025-08-25") using the datetime format'YYYY-MM-DD HH:mm:ss':Since the input string doesn't match the format (no time component), Moment.js falls back to ISO 8601 parsing, which interprets date-only strings as UTC midnight. When
.format('ll')then converts to the user's local timezone, the date shifts back one day for users behind UTC.Fix
Use
'YYYY-MM-DD'as the Moment parse format — this matches the actual stored value format and ensures local-timezone parsing:This is consistent with
getDateFormat()inTableCellDateTime.vue, which already uses'YYYY-MM-DD'for the edit mode — explaining why editing showed the correct date while the cell display didn't.Fixes #2705