Skip to content

Commit e3a0c36

Browse files
iobuhovclaude
authored andcommitted
docs(calendar-web): add openspec change for showMultiDayTimes property
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e13f9cf commit e3a0c36

4 files changed

Lines changed: 147 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-07-23
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Why
2+
3+
In the Calendar widget's week and day views, `react-big-calendar` places any event that
4+
spans more than one day into the top "all-day" row, hiding its start and end times. For
5+
apps where multi-day events have meaningful times (e.g. a booking that starts at 22:00 on
6+
one day and ends at 02:00 the next), authors need those events rendered as timed blocks in
7+
the time grid, showing their start/end times, instead of being flattened into the all-day
8+
row.
9+
10+
`react-big-calendar` already exposes a `showMultiDayTimes` flag for exactly this, but the
11+
Calendar widget did not surface it, so authors had no way to opt in.
12+
13+
## What Changes
14+
15+
Add a `showMultiDayTimes` boolean property (default `false`) to the Calendar widget and pass
16+
it through to `react-big-calendar`. When enabled, multi-day events render in the time grid
17+
with their start/end times in week and day views. To make those times readable on the
18+
event blocks, the widget also supplies `eventTimeRangeStartFormat` and
19+
`eventTimeRangeEndFormat` derived from the widget's configured time format, and keeps them
20+
consistent with the existing `eventTimeRangeFormat` and `showEventDate` behavior.
21+
22+
- `src/Calendar.xml` — add `showMultiDayTimes` boolean property (defaultValue `false`) in
23+
the week/day view group, with caption and description.
24+
- `typings/CalendarProps.d.ts` — add `showMultiDayTimes: boolean` to the container props and
25+
`showMultiDayTimes: boolean` to the preview props (generated typings).
26+
- `src/helpers/CalendarPropsBuilder.ts`:
27+
- Pass `showMultiDayTimes: this.props.showMultiDayTimes` through to the calendar props.
28+
- Add `eventTimeRangeStartFormat` (`"<start> – "`) and `eventTimeRangeEndFormat`
29+
(`" – <end>"`) using the same configured time pattern as `eventTimeRangeFormat`.
30+
- When `showEventDate` is `false`, blank out `eventTimeRangeStartFormat` and
31+
`eventTimeRangeEndFormat` alongside the existing `eventTimeRangeFormat`.
32+
- Unit tests + snapshot update for the above.
33+
- User-facing changelog entry.
34+
35+
## Impact
36+
37+
- **Consumers:** Purely additive. The default is `false`, which preserves the existing
38+
behavior (multi-day events stay in the all-day row), so existing apps are unaffected. Not
39+
breaking.
40+
- **Must NOT break:** `showEventDate=false` must continue to hide all event time ranges,
41+
including the new start/end formats; existing single-day timed event rendering and the
42+
existing `eventTimeRangeFormat` behavior are unchanged.
43+
- **Users:** Authors can opt in to see start/end times for multi-day events in week and day
44+
views. Version bump deferred to release time per repo convention.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## ADDED Requirements
2+
3+
### Requirement: Show multi-day times property
4+
5+
The Calendar widget SHALL expose a `showMultiDayTimes` boolean property (default `false`)
6+
that controls whether events spanning multiple days are rendered as timed blocks (showing
7+
start/end times) in the week and day views instead of being placed in the all-day row.
8+
9+
#### Scenario: Property is available in Studio Pro
10+
11+
- **WHEN** a developer configures the Calendar widget in Studio Pro
12+
- **THEN** a "Show multi-day times" boolean property is available, defaulting to off
13+
14+
#### Scenario: Enabled flag is passed through to the calendar
15+
16+
- **WHEN** `showMultiDayTimes` is set to `true`
17+
- **THEN** the Calendar passes `showMultiDayTimes=true` to `react-big-calendar`, so multi-day
18+
events render as timed blocks in the week and day views
19+
20+
#### Scenario: Disabled by default preserves all-day rendering
21+
22+
- **WHEN** `showMultiDayTimes` is left at its default (`false`)
23+
- **THEN** the Calendar passes `showMultiDayTimes=false`, and multi-day events continue to be
24+
placed in the all-day row (existing behavior is unchanged)
25+
26+
### Requirement: Multi-day event time-range formats
27+
28+
When a time format is configured, the Calendar widget SHALL provide
29+
`eventTimeRangeStartFormat` and `eventTimeRangeEndFormat` for `react-big-calendar`, derived
30+
from the same configured time pattern used by `eventTimeRangeFormat`, so the start and end
31+
times of multi-day events are shown in a locale-aware way.
32+
33+
#### Scenario: Start format renders the start time with a trailing separator
34+
35+
- **WHEN** a time format (e.g. `HH:mm`) is configured and `eventTimeRangeStartFormat` is
36+
called for an event
37+
- **THEN** it returns the event's start time formatted with that pattern, followed by a
38+
" – " separator
39+
40+
#### Scenario: End format renders the end time with a leading separator
41+
42+
- **WHEN** a time format (e.g. `HH:mm`) is configured and `eventTimeRangeEndFormat` is called
43+
for an event
44+
- **THEN** it returns the event's end time formatted with that pattern, preceded by a " – "
45+
separator
46+
47+
#### Scenario: Start, end, and range formats share the same time pattern
48+
49+
- **WHEN** a time format (e.g. `h:mm a`) is configured
50+
- **THEN** `eventTimeRangeFormat`, `eventTimeRangeStartFormat`, and `eventTimeRangeEndFormat`
51+
all format times using that same pattern
52+
53+
#### Scenario: No time format leaves start/end formats unset
54+
55+
- **WHEN** no time format is configured
56+
- **THEN** the widget does not set `eventTimeRangeStartFormat` or `eventTimeRangeEndFormat`
57+
58+
### Requirement: Show event date hides multi-day time ranges
59+
60+
When `showEventDate` is disabled, the Calendar widget SHALL hide all event time-range labels,
61+
including the multi-day start and end formats, so no times are shown on events.
62+
63+
#### Scenario: showEventDate=false blanks all time-range formats
64+
65+
- **WHEN** `showEventDate` is `false` (with a time format configured)
66+
- **THEN** `eventTimeRangeFormat`, `eventTimeRangeStartFormat`, and `eventTimeRangeEndFormat`
67+
all return an empty string
68+
69+
#### Scenario: showEventDate=true preserves all time-range formats
70+
71+
- **WHEN** `showEventDate` is `true` (with a time format configured)
72+
- **THEN** `eventTimeRangeFormat`, `eventTimeRangeStartFormat`, and `eventTimeRangeEndFormat`
73+
all return a non-empty formatted label
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## 1. Property definition
2+
3+
- [x] 1.1 Add `showMultiDayTimes` boolean property (defaultValue `false`) with caption and description to `src/Calendar.xml` in the week/day view group
4+
- [x] 1.2 Regenerate typings: `showMultiDayTimes: boolean` in `CalendarContainerProps` and `CalendarPreviewProps` (`typings/CalendarProps.d.ts`)
5+
6+
## 2. Implementation
7+
8+
- [x] 2.1 Pass `showMultiDayTimes: this.props.showMultiDayTimes` through to the calendar props in `CalendarPropsBuilder.build`
9+
- [x] 2.2 Add `eventTimeRangeStartFormat` (`"<start> – "`) and `eventTimeRangeEndFormat` (`" – <end>"`) using the same configured time pattern as `eventTimeRangeFormat`
10+
- [x] 2.3 When `showEventDate?.value === false`, blank `eventTimeRangeStartFormat` and `eventTimeRangeEndFormat` alongside the existing `eventTimeRangeFormat`
11+
12+
## 3. Tests
13+
14+
- [x] 3.1 Test `showMultiDayTimes=true`/`false` is passed through to calendar props
15+
- [x] 3.2 Test start/end formats use the configured time pattern with the correct leading/trailing separator; and are unset when no time format is configured
16+
- [x] 3.3 Test `showEventDate=false` blanks range/start/end formats; `showEventDate=true` preserves them
17+
- [x] 3.4 Update the Calendar snapshot for the new `data-show-multi-day-times` (and `data-min`/`data-max`) attributes
18+
19+
## 4. Verification
20+
21+
- [x] 4.1 `calendar-web` unit suite passes
22+
- [x] 4.2 Add user-facing changelog entry (new `showMultiDayTimes` property)
23+
- [ ] 4.3 `/code-review` before merge; PR ready
24+
25+
## Notes
26+
27+
- Change is additive; default `false` preserves existing all-day rendering for multi-day events.
28+
- Version bump deferred to release time per repo convention.

0 commit comments

Comments
 (0)