Skip to content

[6.x] Fix calendar view for date fields using a format without time - #15246

Merged
jasonvarga merged 1 commit into
6.xfrom
calendar-date-only-formats
Aug 26, 2026
Merged

[6.x] Fix calendar view for date fields using a format without time#15246
jasonvarga merged 1 commit into
6.xfrom
calendar-date-only-formats

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Aug 24, 2026

Copy link
Copy Markdown
Member

This pull request fixes an issue where the calendar view for collections would break when the collection's date field uses a format without a time component, like Y-m-d. The calendar would render for a moment, then everything apart from the weekday header row would disappear (or, depending on the build, entries would simply never show).

This was happening because when a date field's format has no time, preProcessIndex returns a plain Y-m-d string rather than a full ISO 8601 datetime string. The calendar passed that straight into parseAbsoluteToLocal, which throws for date-only strings, breaking the render.

This PR fixes it by adding a getEntryDate helper which parses date-only values with parseDate and datetime values with parseAbsoluteToLocal. In the week view, date-only entries are shown against midnight. This PR also hides the time label on month view entries when the date format has no time, since it would otherwise show a meaningless, timezone-shifted midnight.


Fixes #15245

@jasonvarga
jasonvarga merged commit 6304682 into 6.x Aug 26, 2026
66 checks passed
@jasonvarga
jasonvarga deleted the calendar-date-only-formats branch August 26, 2026 16:34
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.

Calendar view for collections is broken with a date format without time

2 participants