[WC-3492]: fix(calendar-web): apply custom Header day format to column headers#2312
[WC-3492]: fix(calendar-web): apply custom Header day format to column headers#2312rahmanunver wants to merge 3 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
In Custom view the Header day format was only wired into react-big-calendar's toolbar-title keys (dayHeaderFormat/monthHeaderFormat), so the day/week/month column headers still used RBC's default dayFormat (dd eee, rendering "07 Tue") and the user's pattern was silently dropped. Wire customViewHeaderDayFormat into RBC's per-column keys: dayFormat (day/week columns) and weekdayFormat (month weekday headers). RBC shares a single global dayFormat across day and week, so when both items set different patterns the week pattern wins (matching the existing timeGutterFormat precedence) and a warning is logged. Add unit tests covering both formats, the collision precedence, and the no-format regression.
…ork_week header leak
75753eb to
4daebe8
Compare
AI Code Review
What was reviewed
Skipped (out of scope): Note: CI check results could not be fetched in this environment — verify checks pass before merging. Findings
|
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
What: In the Calendar widget's Custom view, the "Header day format" property now applies to the day, week, and month column headers — not just the toolbar title.
Why: A customer (Mendix 10.24.19, Calendar module 2.4.0) set
Header day format: EE dd-MMbut the day-column header still rendered the default07 Tue.react-big-calendar uses two distinct sets of format keys:
dayHeaderFormat/monthHeaderFormat— the toolbar navigation titledayFormat(week/day columns) andweekdayFormat(month weekday headers) — the per-column headers, the "07 Tue" text the user actually seesCalendarPropsBuilder.buildFormatswiredcustomViewHeaderDayFormatonly into the toolbar-title keys, so the column headers kept RBC's date-fns defaultdayFormat: 'dd eee'and the user's pattern was silently dropped.Fix:
buildFormatsnow also setsformats.dayFormat(day/week columns) andformats.weekdayFormat(month) from the samecustomViewHeaderDayFormatpattern. RBC exposes a single shareddayFormatfor day and week, so when both items set different patterns the week pattern wins (consistent with the existingtimeGutterFormatprecedence) and aconsole.warnis logged on collision. The custom work_week view spreadsformatsinto RBC'sTimeGrid, so it inherits the newdayFormatautomatically.Added unit tests for both formats, the collision precedence + warning, the no-format regression, and the existing time-gutter wiring (21/21 pass).
What should be covered while testing?
dayandweektoolbar items.Header day format = EE dd-MMandTime gutter format = HH:mm.Tue 07-07(not07 Tue); time gutter shows 24h14:00.