@moltenship/calendar 1.0.0-rc.2 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +24 -4
  2. package/dist/index.d.mts +2 -2
  3. package/docs/accessibility.md +304 -0
  4. package/docs/agents/changes.md +449 -0
  5. package/docs/agents/coding-agents.md +117 -0
  6. package/docs/agents/connect.md +435 -0
  7. package/docs/agents/deleting.md +296 -0
  8. package/docs/agents/reference.md +512 -0
  9. package/docs/agents/server.md +317 -0
  10. package/docs/agents/webmcp.md +153 -0
  11. package/docs/agents.md +353 -0
  12. package/docs/annotations.md +196 -0
  13. package/docs/api/changes.md +248 -0
  14. package/docs/api/dnd-kit.md +267 -0
  15. package/docs/api/events.md +152 -0
  16. package/docs/api/ics.md +524 -0
  17. package/docs/api/primitives.md +168 -0
  18. package/docs/api/react.md +236 -0
  19. package/docs/api/recurrence.md +586 -0
  20. package/docs/api/solid.md +460 -0
  21. package/docs/api/store.md +92 -0
  22. package/docs/api/temporal.md +172 -0
  23. package/docs/api.md +57 -0
  24. package/docs/availability.md +573 -0
  25. package/docs/comparison.md +279 -0
  26. package/docs/concepts/anatomy.md +73 -0
  27. package/docs/concepts/events.md +164 -0
  28. package/docs/concepts/how-it-works.md +95 -0
  29. package/docs/concepts/recurrence.md +127 -0
  30. package/docs/concepts/state.md +244 -0
  31. package/docs/concepts/time.md +170 -0
  32. package/docs/guides/dnd-kit.md +333 -0
  33. package/docs/guides/google-calendar-sync.md +1246 -0
  34. package/docs/guides/google-calendar.md +367 -0
  35. package/docs/guides/ics.md +486 -0
  36. package/docs/guides/motion.md +414 -0
  37. package/docs/guides/nextjs-app-router.md +630 -0
  38. package/docs/guides/nextjs.md +149 -0
  39. package/docs/guides/performance.md +103 -0
  40. package/docs/guides/recurring-events.md +583 -0
  41. package/docs/guides/tanstack-query.md +485 -0
  42. package/docs/index.md +118 -0
  43. package/docs/installation.md +194 -0
  44. package/docs/interactions.md +408 -0
  45. package/docs/llms.txt +86 -0
  46. package/docs/migrating-to-2.md +322 -0
  47. package/docs/quick-start.md +159 -0
  48. package/docs/stylex.md +265 -0
  49. package/docs/testing.md +581 -0
  50. package/docs/theme-builder.md +81 -0
  51. package/docs/theming.md +169 -0
  52. package/docs/undo-redo.md +339 -0
  53. package/docs/views/agenda.md +221 -0
  54. package/docs/views/custom-views.md +192 -0
  55. package/docs/views/month.md +109 -0
  56. package/docs/views/resource-columns.md +261 -0
  57. package/docs/views/resource-timeline.md +225 -0
  58. package/docs/views/scrolling.md +192 -0
  59. package/docs/views/week-and-day.md +257 -0
  60. package/docs/views/year.md +138 -0
  61. package/docs/views.md +69 -0
  62. package/package.json +41 -14
  63. package/skills/moltenship-time/SKILL.md +75 -0
  64. package/skills/moltenship-time/references/agent-ready.md +272 -0
  65. package/skills/moltenship-time/references/changes.md +188 -0
  66. package/skills/moltenship-time/references/compose.md +168 -0
  67. package/skills/moltenship-time/references/mistakes.md +98 -0
  68. package/skills/moltenship-time/references/solid.md +202 -0
  69. package/skills/moltenship-time/references/state.md +129 -0
  70. package/skills/moltenship-time/references/testing.md +176 -0
@@ -0,0 +1,279 @@
1
+ # Comparison
2
+
3
+ How Time compares with FullCalendar and react-big-calendar, as of October 2026.
4
+
5
+ Source: https://time.molten.sh/docs/comparison
6
+
7
+ This page compares Time with two React calendars that many teams already use:
8
+ [FullCalendar](https://fullcalendar.io) 7.1, through `@fullcalendar/react` and its premium
9
+ plugins, and [react-big-calendar](https://github.com/bigcalendar/react-big-calendar) 1.20. It's
10
+ accurate as of **October 2026**. Claims about Time come from these docs and the code on `main`.
11
+ Claims about the other two link their sources in the notes at the end of the page; a ✗ without a
12
+ note means we found no such feature in their docs or code. If something here is wrong or out of
13
+ date, [open an issue](https://github.com/Moltenship/time/issues).
14
+
15
+ > **Time is new, and on npm as a release candidate**
16
+ >
17
+ > Time started in August 2026 and has one maintainer. Its packages are on npm as a release candidate
18
+ > for 1.0.0, its first release, and its API can still change before 1.0.0 if the release candidate
19
+ > turns up problems. FullCalendar has been developed since 2009 and react-big-calendar since 2015.
20
+ > Both are downloaded more than a million times a week and run in production in many apps. Read the
21
+ > rows below with that in mind.
22
+
23
+ **✓** means built in. **Partial** means it's there, with the limit the note gives. **✗** means
24
+ it isn't built in: you'd write it yourself or add another library.
25
+
26
+ ## License and pricing
27
+
28
+ | | Time | FullCalendar | react-big-calendar |
29
+ | --------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
30
+ | License | ✓ MIT. `@moltenship/ics` adds Unicode-3.0 for its CLDR data | Partial. The standard views are MIT. The premium plugins have a commercial license[^fc-license] | ✓ MIT[^rbc-license] |
31
+ | Resource and timeline views | Free, MIT | Premium. $480 for one developer, less per seat for more, down to $240 a seat for ten. A one-time payment for perpetual use, with a year of upgrades and email support. Free for registered non-profits (CC BY-NC-ND) and for projects that are open source under the AGPLv3[^fc-license] | Resource columns are free. No timeline[^rbc-resources] |
32
+
33
+ ## Views
34
+
35
+ | | Time | FullCalendar | react-big-calendar |
36
+ | --------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
37
+ | Month | ✓ [Month](./views/month.md) | ✓ `dayGridMonth`[^fc-views] | ✓ `month`[^rbc-views] |
38
+ | Week and day | ✓ [Week and day](./views/week-and-day.md) | ✓ `timeGridWeek`, `timeGridDay`[^fc-views] | ✓ `week`, `work_week`, `day`[^rbc-views] |
39
+ | Agenda or list | ✓ [Agenda](./views/agenda.md), also as a scrolling list | ✓ `list` views, from a day to a year[^fc-views] | ✓ `agenda`[^rbc-views] |
40
+ | Year | ✓ [Year](./views/year.md). Read-only: a day's events open in a popover | ✓ `multiMonthYear`[^fc-views] | ✗ Not built in[^rbc-year] |
41
+ | 3-day and other spans | ✓ `createThreeDayView`. Other spans as a [custom view](./views/custom-views.md) | ✓ Any day count, set with `duration`[^fc-custom] | ✓ As a custom view. The docs' example is a 3-day view[^rbc-custom] |
42
+ | Scrolling without end | ✓ [Week, 3-day, day, month and agenda](./views/scrolling.md), as Apple's Calendar does on iPad | ✗ An open request since 2015[^fc-scrolling] | ✗ Not among its views[^rbc-views] |
43
+ | Resource columns | ✓ [Resource columns](./views/resource-columns.md), with groups that collapse | ✓ Premium: `resourceTimeGrid` and `resourceDayGrid`[^fc-resource] | Partial. In the day and week time grids only, not month or agenda[^rbc-resources] |
44
+ | Resource timeline | ✓ [Resource timeline](./views/resource-timeline.md) for a day, a week or a month | ✓ Premium, also as a timeline without resources[^fc-resource] | ✗ Not built in[^rbc-timeline] |
45
+ | Custom views | ✓ A strategy and a Renderer | Partial. New spans for the built-in types, or a view from scratch as a function or a React component. Its props aren't documented, and dragging is left to you[^fc-custom] | ✓ A component with `range`, `navigate` and `title`[^rbc-custom] |
46
+
47
+ ## Interaction
48
+
49
+ | | Time | FullCalendar | react-big-calendar |
50
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
51
+ | Drag to move | ✓ In the month, time grid and resource views ([Interactions](./interactions.md#drag-resize-and-create)) | ✓ With the `interaction` plugin[^fc-dnd] | ✓ With the `withDragAndDrop` addon[^rbc-dnd] |
52
+ | Resize | Partial. Timed events in the time grids and resource columns, and bars in the timeline. All-day events, the month's included, from the keyboard only | ✓[^fc-dnd] | ✓[^rbc-dnd] |
53
+ | Create | ✓ Drag across empty time or days, or press Space on a slot or a day. A click doesn't create | ✓ Select a range, or handle a date click[^fc-dnd] | ✓ Select slots with a click or a drag[^rbc-dnd] |
54
+ | Touch | ✓ Press and hold for 450 ms to drag | ✓ Press and hold, 1 second by default, configurable[^fc-dnd] | Partial. Press and hold to select slots, 250 ms by default. Dragging an event by touch takes a tap first, and has reported bugs[^rbc-touch] |
55
+ | Keyboard move and resize | ✓ Space picks an event up and Shift+Space its edge, the arrow keys move or resize it, Enter saves it ([keyboard](./accessibility.md#changing-events)) | ✗ An open request since 2015[^fc-keyboard] | ✗ The addon handles no keys[^rbc-keyboard] |
56
+ | Drops from outside | Partial. With dnd-kit, the [dnd-kit adapter](./api/dnd-kit.md) turns your items dragged in into events and sends events dragged out to your drop zones. Other libraries call [`startCalendarDrop` and `monitorCalendarDrags`](./api/changes.md#drags-from-and-to-the-rest-of-the-page) through a binding you write. No HTML drag and drop | ✓ `Draggable`, or any drag library through `ThirdPartyDraggable`[^fc-external] | ✓ `onDropFromOutside`, with HTML drag and drop[^rbc-external] |
57
+ | Undo and redo | ✓ An opt-in [history](./undo-redo.md) with keyboard shortcuts and an undo toast | ✗ Each change has a `revert()`, but there's no history[^fc-revert] | ✗ |
58
+
59
+ ## Accessibility
60
+
61
+ | | Time | FullCalendar | react-big-calendar |
62
+ | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
63
+ | Keyboard navigation | ✓ Each view is one tab stop. Arrow, Home, End and Page keys move between days, slots and events ([Accessibility](./accessibility.md#keyboard)) | Partial. Tab reaches every interactive element. Events are focusable when they have a URL or an `eventClick` handler, or with `eventInteractive`. No arrow keys[^fc-a11y] | Partial. Time grid events are focusable; month events aren't. No arrow-key navigation[^rbc-a11y] |
64
+ | Screen reader announcements | ✓ A live region announces moves, resizes and creates, from the keyboard and the pointer. Events are named in full | Partial. ARIA attributes, and labels you can change. No announcements of changes found[^fc-a11y] | ✗ No live region. Open issues about the month view's roles and "+N more"[^rbc-a11y] |
65
+ | Automated checks | ✓ axe-core over every built-in view but the 3-day ones, in Chromium on every PR and in Firefox and WebKit before each release. Serious and critical issues fail. Contrast and target-size tests too. No WCAG conformance claim or third-party audit | Partial. The 7.0 notes say every view passes axe. We found no automated accessibility run in its public CI[^fc-a11y] | ✗ No axe tests[^rbc-a11y] |
66
+ | Right-to-left | ✓ Month, week, day and agenda mirror, and so do the arrow keys ([right-to-left](./accessibility.md#right-to-left)) | ✓ `direction: "rtl"`[^fc-rtl] | ✓ `rtl`[^rbc-rtl] |
67
+
68
+ ## Time
69
+
70
+ | | Time | FullCalendar | react-big-calendar |
71
+ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
72
+ | Date values | Native Temporal: `Instant`, `PlainDate` and `PlainDateTime`. No `Date` ([Time](./concepts/time.md)) | `Date` in its API. Temporal inside, through the functions of `temporal-polyfill`, a peer dependency you install[^fc-time] | `Date`, with a localizer for moment, Luxon, Globalize, date-fns or Day.js[^rbc-time] |
73
+ | Temporal required | A global `Temporal`. In browsers without it, load a polyfill ([Installation](./installation.md#temporal)), which adds 20.5 kB gzipped | No global `Temporal`, but the `temporal-polyfill` package as a peer dependency[^fc-time] | No[^rbc-time] |
74
+ | Named time zones | ✓ Any IANA zone, changeable at runtime | ✓ Without a plugin since 7.0. The `Date`s it hands you are in local time or UTC, so its docs convert them with Temporal[^fc-time] | Partial. Through the localizer's default zone with moment-timezone, Luxon or Day.js. Not with date-fns[^rbc-time] |
75
+ | Daylight saving | ✓ 23- and 25-hour days, and skipped and repeated hours ([DST](./concepts/time.md#daylight-saving-time)) | No docs page. 7.1.0 fixed timeline slots across a change[^fc-dst] | Partial. The localizers adjust time slots for DST, but a bug remains open[^rbc-dst] |
76
+ | Secondary time zone | ✓ [Extra hour columns](./views/week-and-day.md#secondary-time-zones), which account for either zone's clock changes | ✗ An open request since 2017[^fc-secondary] | ✗ A request closed by a bot[^rbc-secondary] |
77
+ | Localization | Partial. Dates and times follow any `locale` through `Intl`. The views' own words are English in source you edit, and announcements take messages you pass | ✓ 79 locales for its words, screen reader labels, date formats and the first day of the week[^fc-locale] | ✓ `culture` from the localizer, and `messages` for its words[^rbc-locale] |
78
+
79
+ ## Data
80
+
81
+ | | Time | FullCalendar | react-big-calendar |
82
+ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
+ | Recurring events | ✓ `@moltenship/calendar-recurrence`: RRULE, EXDATE and RDATE, overrides, and cancelled occurrences ([Recurring events](./concepts/recurrence.md)) | ✓ Simple daily or weekly recurrence built in. RRULE with `exdate` and `exrule` through the `rrule` plugin[^fc-rrule] | ✗ Declined by its creator in 2017[^rbc-recurrence] |
84
+ | Edit this, following or all | ✓ A scope dialog, and `resolveRecurrenceEdit` works out what to save ([guide](./guides/recurring-events.md)) | ✗ Not in the docs. `groupId` moves occurrences together[^fc-rrule] | ✗ |
85
+ | ICS import | ✓ `@moltenship/ics` parses RFC 5545 into Temporal values, with Windows zone names and line-numbered issues ([ICS](./api/ics.md)) | ✓ The `icalendar` plugin loads a feed URL when the calendar loads, and again on `refetchEvents`[^fc-ics] | ✗ |
86
+ | ICS export | Partial. `stringifyIcsComponents` writes a syntax tree you build. No writer from typed events yet | ✗ Not in the docs[^fc-ics] | ✗ |
87
+ | Working hours | ✓ For the calendar and per resource, each in its own time zone, with closed days and holidays ([Availability](./availability.md)) | ✓ `businessHours`. Per resource in premium[^fc-hours] | Partial. No working hours setting. Shade time with `backgroundEvents` or `slotPropGetter`, per resource, and limit the hours shown with `min` and `max`[^rbc-hours] |
88
+ | Busy status | ✓ Busy and unavailable kept apart, with `busyAt`, `resourceStatusAt` and a busy badge | ✗ | ✗ |
89
+ | Conflict rules | ✓ Policies block, warn about or allow double-booking per resource, and keep changes inside working hours. Previews show the verdict while you drag | ✓ `eventOverlap`, `eventConstraint`, `eventAllow` and their `select` twins[^fc-hours] | ✗ `no-overlap` only changes the layout[^rbc-hours] |
90
+ | Pending changes, optimistic updates | ✓ An async `onEventChange` keeps the change on screen as pending and rolls it back if saving fails. Of racing changes, the newest shows; the docs show how to apply saves in order ([pending changes](./interactions.md#pending-changes)) | Partial. Callbacks get `revert()` to undo a failed save. No pending state[^fc-revert] | ✗ You update your state in `onEventDrop`[^rbc-state] |
91
+
92
+ ## Architecture and integration
93
+
94
+ | | Time | FullCalendar | react-big-calendar |
95
+ | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
96
+ | Headless core | ✓ The event engine, the Temporal helpers and the calendar's state and actions use no React. The React parts render plain elements ([How it works](./concepts/how-it-works.md)) | Partial. `@full-ui/headless-calendar`, MIT, is its internal core; its readme calls it a beta[^fc-headless] | ✗ |
97
+ | Frameworks | React. A SolidJS 2 package renders the same headless calendar as a preview, without the styled views ([Solid](./api/solid.md)) | ✓ React, Vue 3, Angular, Preact, plain JavaScript and a web component[^fc-frameworks] | React only[^rbc-react] |
98
+ | React versions | 19 | 17 to 19[^fc-frameworks] | 16.14 to 19[^rbc-react] |
99
+ | Server rendering, Next.js | ✓ Renders the same markup on the server and in the browser. Calendars are Client Components. A full [App Router example](./guides/nextjs-app-router.md) with Server Actions | ✓ The React package is written in React since 7.0, with server rendering and StrictMode. A Next.js example project[^fc-react] | Partial. Its docs don't cover server rendering or Next.js. App Router users put it in a Client Component[^rbc-ssr] |
100
+ | Own the code | ✓ Every view's components, the toolbar and the theme are source files you add with the shadcn CLI ([UI source](./installation.md#ui-source-optional)). Date math, layout, and the drag and keyboard logic stay in `@moltenship/calendar` | Partial. A shadcn registry adds a wrapper, a toolbar and Tailwind classes for each part. The views' markup and behaviour stay in `@fullcalendar/react`[^fc-shadcn] | ✗ |
101
+ | Theming | ✓ CSS tokens for light and dark, an event palette, a [theme builder](./theme-builder.md), and the views in [Tailwind or StyleX](./stylex.md) | ✓ Five themes with dark mode, CSS variables, class names for Tailwind, and MUI and Bootstrap 5 themes[^fc-themes] | Partial. One stylesheet, with Sass variables to override[^rbc-theme] |
102
+ | TypeScript | ✓ Written in strict TypeScript. Your event and ID types carry through | ✓ Written in TypeScript, types included[^fc-frameworks] | Partial. Written in JavaScript. `@types/react-big-calendar` is at 1.16[^rbc-types] |
103
+
104
+ ## Performance and size
105
+
106
+ | | Time | FullCalendar | react-big-calendar |
107
+ | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
108
+ | Virtualization and large data | ✓ Resource columns, the resource timeline, the agenda and the scrolling views render only what's in view. Month and time grids render the visible range. Events sit in an interval index, so each view reads only its range ([Performance](./guides/performance.md)) | Partial. Opt-in and premium, for the resource timeline only. Other views are planned[^fc-virtual] | ✗ No virtualization. Reports about large data were closed by a bot, and a fix isn't merged[^rbc-perf] |
109
+ | Bundle size, gzipped | 143 kB. 67 kB if your app already ships Base UI's select, popover and tooltip, `cn` and lucide-react | 84 kB. 118 kB with the premium resource views | 99 kB with Luxon and a time zone. 85 kB with date-fns, without time zones |
110
+
111
+ ### How the sizes were measured
112
+
113
+ Each library rendered the same calendar from one entry file: month, week, day and agenda (or list)
114
+ views, the library's toolbar, and dragging, resizing and creating turned on, in the Europe/Berlin
115
+ time zone. For Time, that's the [Quick start](./quick-start.md)'s calendar with `onEventChange` and
116
+ the `Announcer` added, built from the registry source that `shadcn add` copies, at commit
117
+ `ed3f9a1b`, which is a 1.x build: it doesn't count `@ui-sdk/core` and `@ui-sdk/react`, which 2.0
118
+ adds. FullCalendar used its classic theme. react-big-calendar used its Luxon localizer, since
119
+ its date-fns localizer can't take a time zone, and its drag-and-drop addon, imported from
120
+ `react-big-calendar/lib/addons/dragAndDrop` as its docs show; that path is CommonJS and brings a
121
+ second copy of some modules. Each entry was bundled with esbuild 0.28.2
122
+ (`--bundle --minify --format=esm --target=es2022`), with React and React DOM left out and CSS not
123
+ counted, then compressed with `gzip -9`. A kB is 1,000 bytes.
124
+
125
+ | Bundle | Minified | Minified and gzipped |
126
+ | ---------------------------------------------------------------------------------------- | -------- | -------------------- |
127
+ | Time: week, day, month and agenda, with the toolbar and the shadcn components they use | 430 kB | 142.6 kB |
128
+ | The same, without the shadcn stack: Base UI, Floating UI, `cn`, lucide-react and helpers | 218 kB | 67.3 kB |
129
+ | Time with resource columns and the resource timeline added | 481 kB | 157.6 kB |
130
+ | The same, without the shadcn stack: Base UI, Floating UI, `cn`, lucide-react and helpers | 269 kB | 82.1 kB |
131
+ | `temporal-polyfill/global` 1.0.6, for browsers without Temporal | 59 kB | 20.5 kB |
132
+ | FullCalendar 7.1.2: month, week, day and list, with interaction | 301 kB | 84.3 kB |
133
+ | FullCalendar 7.1.2 with premium resource timeline and resource time grid | 429 kB | 118.0 kB |
134
+ | react-big-calendar 1.20.0 with drag and drop and Luxon 3.7 | 323 kB | 98.6 kB |
135
+ | react-big-calendar 1.20.0 with drag and drop and date-fns 4.4, without time zones | 288 kB | 84.9 kB |
136
+
137
+ Time's views are the largest of the three. About half of their minified size is the shadcn
138
+ components they're built on: Base UI's select, popover and tooltip, with Floating UI. An app that
139
+ already uses those through shadcn/ui ships that code already, which is what the "without" rows show.
140
+ FullCalendar's numbers include the parts of `temporal-polyfill` it imports. Time's don't include a
141
+ polyfill, which only browsers without Temporal need.
142
+
143
+ ## Maturity
144
+
145
+ | | Time | FullCalendar | react-big-calendar |
146
+ | ------------------------------ | --------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------- |
147
+ | Since | August 2026 | 2009[^fc-maturity] | 2015[^rbc-maturity] |
148
+ | Latest release | 1.0.0-rc.1, a release candidate, October 2026 | 7.1.2, October 12, 2026[^fc-maturity] | 1.20.0, June 1, 2026[^rbc-maturity] |
149
+ | Releases in the last 12 months | 1, a release candidate | 8[^fc-maturity] | 2[^rbc-maturity] |
150
+ | Weekly npm downloads | None yet, first published in October 2026 | 1.8 million for `@fullcalendar/react`[^fc-downloads] | 1.17 million[^rbc-downloads] |
151
+ | GitHub | 1 contributor | 20.7k stars, about 130 contributors[^fc-maturity] | 8.8k stars, about 240 contributors[^rbc-maturity] |
152
+ | Support | GitHub issues | Community support, and email support with a premium license[^fc-license] | GitHub issues[^rbc-maturity] |
153
+
154
+ FullCalendar and react-big-calendar have years of bug reports behind them, answers on Stack
155
+ Overflow, example projects and people who know them. Time has none of that yet.
156
+
157
+ ## When to choose which
158
+
159
+ **FullCalendar** if you need a calendar you can rely on in production today, if your app uses Vue,
160
+ Angular or no framework, if you need many locales out of the box, or if you want a vendor with paid
161
+ support. Its premium views cost money, but less than building a scheduler. Its React package has
162
+ been written in React since 7.0, renders on the server, handles named time zones through Temporal
163
+ and has shadcn themes, so none of those set Time apart.
164
+
165
+ **react-big-calendar** if you want a free MIT calendar with month, week, day and agenda views and
166
+ drag and drop, and you don't need a year view, a timeline, keyboard editing, recurring events or
167
+ time zones beyond a localizer's default. It had two releases in the last twelve months, so expect
168
+ fixes to come slowly.
169
+
170
+ **Time** if you're on React 19 and can start on a pre-release, and you want Temporal from end to
171
+ end, view components you own as source, editing by keyboard with screen reader announcements,
172
+ edits to recurring series, availability and conflict rules, resource views under the MIT license,
173
+ or a calendar an [AI agent](./agents.md) can read and change under your app's rules. Don't choose
174
+ it yet if you need a stable release with a track record, or styled views for a framework other
175
+ than React.
176
+
177
+ [^fc-license]: FullCalendar's [pricing](https://fullcalendar.io/pricing), [purchase](https://fullcalendar.io/purchase) and [license](https://fullcalendar.io/license) pages, its [premium](https://fullcalendar.io/docs/premium) docs, and the [plugin index](https://fullcalendar.io/docs/plugin-index), which marks the premium plugins.
178
+
179
+ [^rbc-license]: react-big-calendar's [LICENSE](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/LICENSE).
180
+
181
+ [^fc-views]: FullCalendar's [month](https://fullcalendar.io/docs/month-view), [time grid](https://fullcalendar.io/docs/timegrid-view), [list](https://fullcalendar.io/docs/list-view) and [multi-month](https://fullcalendar.io/docs/multimonth-grid) views.
182
+
183
+ [^rbc-views]: react-big-calendar's [`src/Views.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Views.js#L8-L14).
184
+
185
+ [^rbc-year]: [#2375](https://github.com/bigcalendar/react-big-calendar/issues/2375), "Need a year view", closed by a bot in May 2026.
186
+
187
+ [^fc-custom]: FullCalendar's [custom view with settings](https://fullcalendar.io/docs/custom-view-with-settings) and [custom view with JS](https://fullcalendar.io/docs/custom-view-with-js).
188
+
189
+ [^fc-scrolling]: [fullcalendar#2276](https://github.com/fullcalendar/fullcalendar/issues/2276), "Continuous scrolling of months".
190
+
191
+ [^rbc-custom]: react-big-calendar's [Creating custom views](https://bigcalendar.github.io/react-big-calendar/?path=/docs/guides-creating-custom-views--docs) and its [3-day example](https://bigcalendar.github.io/react-big-calendar/?path=/story/examples--example-9).
192
+
193
+ [^fc-resource]: FullCalendar's [vertical resource view](https://fullcalendar.io/docs/vertical-resource-view) and [timeline view](https://fullcalendar.io/docs/timeline-view), both premium.
194
+
195
+ [^rbc-resources]: Only the time grid reads `resources`: [`src/TimeGrid.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/TimeGrid.js#L256-L258). See the [resource scheduling example](https://bigcalendar.github.io/react-big-calendar/?path=/story/examples--example-11).
196
+
197
+ [^rbc-timeline]: [#1844](https://github.com/bigcalendar/react-big-calendar/issues/1844), "Resource Timeline component", closed by a bot in May 2026.
198
+
199
+ [^fc-dnd]: FullCalendar's [dragging and resizing](https://fullcalendar.io/docs/event-dragging-resizing), [`selectable`](https://fullcalendar.io/docs/selectable), [touch](https://fullcalendar.io/docs/touch) and [`eventLongPressDelay`](https://fullcalendar.io/docs/eventLongPressDelay).
200
+
201
+ [^rbc-dnd]: react-big-calendar's [`withDragAndDrop`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/addons/dragAndDrop/withDragAndDrop.js#L17-L29), [`selectable`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L527-L534) and [`onSelectSlot`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L331-L359).
202
+
203
+ [^rbc-touch]: react-big-calendar's [`longPressThreshold`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L537-L544), the addon's [`EventWrapper.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/addons/dragAndDrop/EventWrapper.js#L41-L61), and [#2413](https://github.com/bigcalendar/react-big-calendar/issues/2413), "Drag and drop on touch".
204
+
205
+ [^fc-keyboard]: [fullcalendar#2535](https://github.com/fullcalendar/fullcalendar/issues/2535), "Event drag-n-drop / resize with keyboard", open since 2015.
206
+
207
+ [^rbc-keyboard]: The addon's [`withDragAndDrop.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/addons/dragAndDrop/withDragAndDrop.js) has no key handling, and [`src/Selection.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Selection.js#L360) uses Escape only to cancel.
208
+
209
+ [^fc-external]: FullCalendar's [external dragging](https://fullcalendar.io/docs/external-dragging) and [third-party dragging](https://fullcalendar.io/docs/third-party-dragging).
210
+
211
+ [^rbc-external]: react-big-calendar's [drag from outside example](https://bigcalendar.github.io/react-big-calendar/?path=/story/addons-drag-and-drop--example-3).
212
+
213
+ [^fc-revert]: FullCalendar's [`eventDrop`](https://fullcalendar.io/docs/eventDrop), whose `revert()` is "useful if an ajax call should fail".
214
+
215
+ [^fc-a11y]: FullCalendar's [accessibility](https://fullcalendar.io/docs/accessibility), [`eventInteractive`](https://fullcalendar.io/docs/eventInteractive) and [hints](https://fullcalendar.io/docs/hints) docs, [fullcalendar#6527](https://github.com/fullcalendar/fullcalendar/issues/6527), "ARIA grid, roving tabindex", the [upgrade notes for 7.0](https://fullcalendar.io/docs/upgrading-from-v6), and its [CI workflows](https://github.com/fullcalendar/fullcalendar/tree/main/.github/workflows).
216
+
217
+ [^rbc-a11y]: react-big-calendar's [`TimeGridEvent.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/TimeGridEvent.js#L55-L61) gives time grid events a `tabIndex`, and [`EventCell.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/EventCell.js#L62-L74) doesn't. Open issues [#2538](https://github.com/bigcalendar/react-big-calendar/issues/2538) and [#2045](https://github.com/bigcalendar/react-big-calendar/issues/2045). Its [`package.json`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/package.json) has no axe.
218
+
219
+ [^fc-rtl]: FullCalendar's [`direction`](https://fullcalendar.io/docs/direction).
220
+
221
+ [^rbc-rtl]: react-big-calendar's [`rtl`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L560) prop.
222
+
223
+ [^fc-time]: FullCalendar's [date library](https://fullcalendar.io/docs/date-library), [temporal-polyfill](https://fullcalendar.io/docs/temporal-polyfill) and [`timeZone`](https://fullcalendar.io/docs/timeZone) docs.
224
+
225
+ [^rbc-time]: react-big-calendar's [dates guide](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/stories/guides/Dates.mdx#L8-L10), its [localizers](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/index.js#L11-L16), its [time zones guide](https://bigcalendar.github.io/react-big-calendar/?path=/docs/guides-timezones--docs), and the [date-fns localizer](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/localizers/date-fns.js).
226
+
227
+ [^fc-dst]: FullCalendar's [7.1.0 release notes](https://github.com/fullcalendar/fullcalendar/releases/tag/v7.1.0): "Timeline view, account for DST in timeslots".
228
+
229
+ [^rbc-dst]: react-big-calendar's [`localizer.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/localizer.js) and [`TimeGutter.js`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/TimeGutter.js), and [#2534](https://github.com/bigcalendar/react-big-calendar/issues/2534), a date missing from the month view in March 2024.
230
+
231
+ [^fc-secondary]: [fullcalendar#3964](https://github.com/fullcalendar/fullcalendar/issues/3964), "multiple timeGrid/timeline axis, each with different time zone".
232
+
233
+ [^rbc-secondary]: [#2306](https://github.com/bigcalendar/react-big-calendar/issues/2306), "Support for Displaying Multiple Timezones", closed by a bot in May 2026.
234
+
235
+ [^fc-locale]: FullCalendar's [`locale`](https://fullcalendar.io/docs/locale). `@fullcalendar/react` 7.1.2 ships 79 locale files.
236
+
237
+ [^rbc-locale]: react-big-calendar's [`culture`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L658) and [`messages`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L861) props.
238
+
239
+ [^fc-rrule]: FullCalendar's [recurring events](https://fullcalendar.io/docs/recurring-events) and [RRule plugin](https://fullcalendar.io/docs/rrule-plugin).
240
+
241
+ [^rbc-recurrence]: [#355](https://github.com/bigcalendar/react-big-calendar/issues/355): "I don't want to provide such functionality in the library".
242
+
243
+ [^fc-ics]: FullCalendar's [iCalendar plugin](https://fullcalendar.io/docs/icalendar).
244
+
245
+ [^fc-hours]: FullCalendar's [`businessHours`](https://fullcalendar.io/docs/businessHours), [business hours per resource](https://fullcalendar.io/docs/businessHours-per-resource), [`eventConstraint`](https://fullcalendar.io/docs/eventConstraint), [`eventOverlap`](https://fullcalendar.io/docs/eventOverlap) and [`selectAllow`](https://fullcalendar.io/docs/selectAllow).
246
+
247
+ [^rbc-hours]: react-big-calendar's [`backgroundEvents`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L148-L168), [`slotPropGetter`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L577-L586), [`min` and `max`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/Calendar.js#L627-L634), its [time grid](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/src/TimeGrid.js#L256-L258), and [`dayLayoutAlgorithm`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/stories/props/dayLayoutAlgorithm.mdx#L9-L13).
248
+
249
+ [^rbc-state]: react-big-calendar's [drag and drop example](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/stories/demos/exampleCode/dnd.js#L14-L43).
250
+
251
+ [^fc-headless]: [`@full-ui/headless-calendar`](https://www.npmjs.com/package/@full-ui/headless-calendar) on npm.
252
+
253
+ [^fc-frameworks]: FullCalendar's [React](https://fullcalendar.io/docs/react), [Vue](https://fullcalendar.io/docs/vue), [Angular](https://fullcalendar.io/docs/angular) and [web component](https://fullcalendar.io/docs/web-component) docs, and the [upgrade notes for 7.0](https://fullcalendar.io/docs/upgrading-from-v6).
254
+
255
+ [^rbc-react]: react-big-calendar's [`package.json`](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/package.json).
256
+
257
+ [^fc-react]: FullCalendar's [React docs](https://fullcalendar.io/docs/react): "server-side rendering and StrictMode work".
258
+
259
+ [^rbc-ssr]: [#2436](https://github.com/bigcalendar/react-big-calendar/issues/2436) and [#2631](https://github.com/bigcalendar/react-big-calendar/issues/2631).
260
+
261
+ [^fc-shadcn]: FullCalendar's [shadcn/ui docs](https://fullcalendar.io/docs/shadcn) and its registry item [`monarch-event-calendar`](https://shadcn-registry.fullcalendar.io/monarch-event-calendar.json).
262
+
263
+ [^fc-themes]: FullCalendar's [stock themes](https://fullcalendar.io/docs/stock-themes) and [custom themes](https://fullcalendar.io/docs/custom-themes).
264
+
265
+ [^rbc-theme]: react-big-calendar's [readme](https://github.com/bigcalendar/react-big-calendar/blob/v1.20.0/README.md#L153-L165).
266
+
267
+ [^rbc-types]: [`@types/react-big-calendar`](https://www.npmjs.com/package/@types/react-big-calendar) on npm.
268
+
269
+ [^fc-virtual]: FullCalendar's [virtual rendering](https://fullcalendar.io/docs/virtual-rendering) and [`virtualization`](https://fullcalendar.io/docs/virtualization).
270
+
271
+ [^rbc-perf]: [#2752](https://github.com/bigcalendar/react-big-calendar/issues/2752) and [#2068](https://github.com/bigcalendar/react-big-calendar/issues/2068), closed by a bot in May 2026, and the open fix [#2753](https://github.com/bigcalendar/react-big-calendar/pull/2753).
272
+
273
+ [^fc-maturity]: FullCalendar's [GitHub repository](https://github.com/fullcalendar/fullcalendar), [contributors](https://github.com/fullcalendar/fullcalendar/graphs/contributors) and [releases](https://github.com/fullcalendar/fullcalendar/releases).
274
+
275
+ [^rbc-maturity]: react-big-calendar's [GitHub repository](https://github.com/bigcalendar/react-big-calendar), [contributors](https://github.com/bigcalendar/react-big-calendar/graphs/contributors), [releases](https://github.com/bigcalendar/react-big-calendar/releases) and [npm versions](https://www.npmjs.com/package/react-big-calendar?activeTab=versions).
276
+
277
+ [^fc-downloads]: npm's [download counts](https://api.npmjs.org/downloads/point/2026-10-06:2026-10-12/@fullcalendar/react) for October 6 to 12, 2026.
278
+
279
+ [^rbc-downloads]: npm's [download counts](https://api.npmjs.org/downloads/point/2026-10-06:2026-10-12/react-big-calendar) for October 6 to 12, 2026.
@@ -0,0 +1,73 @@
1
+ # Anatomy
2
+
3
+ The parts a calendar is built from, and their names in code.
4
+
5
+ Source: https://time.molten.sh/docs/concepts/anatomy
6
+
7
+ A calendar is made of the parts your `createCalendar` factory returns, such as `Calendar.Toolbar`,
8
+ and a few components from the registry. The diagram labels each part with its name in code, and the
9
+ code below it puts the same parts together.
10
+
11
+ > Diagram: see it at https://time.molten.sh/docs/concepts/anatomy
12
+
13
+ ```tsx
14
+ <Calendar.Root
15
+ events={meetings}
16
+ defaultAnchorDate={today}
17
+ defaultTimeZone="Europe/Berlin"
18
+ locale="en-US"
19
+ weekRules={weekRules}
20
+ >
21
+ <Calendar.Frame>
22
+ <Calendar.Toolbar>
23
+ <Calendar.TodayTrigger>Today</Calendar.TodayTrigger>
24
+ <Calendar.PreviousTrigger aria-label="Previous period" />
25
+ <Calendar.NextTrigger aria-label="Next period" />
26
+ <Calendar.Title />
27
+ <ViewSwitcher value={view} onValueChange={setView} options={viewOptions} />
28
+ </Calendar.Toolbar>
29
+ <aside>
30
+ <MiniMonth
31
+ locale="en-US"
32
+ selectedDate={anchorDate}
33
+ onSelectDate={setAnchorDate}
34
+ today={today}
35
+ weekStartsOn={1}
36
+ />
37
+ </aside>
38
+ <Calendar.Viewport>
39
+ <Calendar.ActiveView />
40
+ </Calendar.Viewport>
41
+ </Calendar.Frame>
42
+ </Calendar.Root>
43
+ ```
44
+
45
+ - **`Root`** holds the calendar's state and renders no element of its own. Every part and hook
46
+ works anywhere inside it.
47
+ - **`Frame`, `Toolbar`, `Title`, `Viewport`,** and the three triggers each render one element with a
48
+ `data-calendar-part` attribute, such as `data-calendar-part="today-trigger"`, for styling. The
49
+ [component reference](../api/react.md#components) lists them.
50
+ - **`ActiveView`** renders the active view's Renderer inside the viewport.
51
+ - **`ViewSwitcher`** and **`MiniMonth`** come from `registry/calendar`. They're plain components:
52
+ you connect them to the calendar with `setView`, `setAnchorDate`, and the `view` and
53
+ `anchorDate` state. `Calendar.ViewSwitcher` is an unstyled `<select>` you can use instead.
54
+
55
+ The registry's `CalendarToolbar` renders the toolbar parts above, styled, and puts its children at
56
+ the end. The [Quick start](../quick-start.md) uses it:
57
+
58
+ ```tsx
59
+ <CalendarToolbar calendar={Calendar}>
60
+ <ViewSwitcher value={view} onValueChange={setView} options={viewOptions} />
61
+ </CalendarToolbar>
62
+ ```
63
+
64
+ ## Views
65
+
66
+ `ActiveView` draws the rest. Each built-in view has its own anatomy:
67
+
68
+ - [Week and day](../views/week-and-day.md#anatomy): Day headers, the all-day row, the time gutter, columns, and events.
69
+ - [Month](../views/month.md#anatomy): Week rows, day cells, event chips, multi-day bars, and +N more.
70
+ - [Agenda](../views/agenda.md#anatomy): Day groups, items, the All day badge, and the empty state.
71
+ - [Year](../views/year.md#anatomy): Twelve month grids and a day's popover.
72
+ - [Resource columns](../views/resource-columns.md#anatomy): Resource headers, the time gutter, and a column per resource.
73
+ - [Resource timeline](../views/resource-timeline.md#anatomy): The time header, resource rows, and event bars.
@@ -0,0 +1,164 @@
1
+ # Events and adapters
2
+
3
+ How Time reads your event records, and what happens when one is invalid.
4
+
5
+ Source: https://time.molten.sh/docs/concepts/events
6
+
7
+ Time has no event class of its own. You pass an array of your own records to `Root`, and an
8
+ **adapter** tells Time how to read each one: its ID, title, time range, and the resources it belongs
9
+ to.
10
+
11
+ ```tsx title="bookings.tsx"
12
+ import { createCalendar, defineEventAdapter, type CalendarDiagnostic } from "@moltenship/calendar";
13
+
14
+ interface Booking {
15
+ readonly id: `booking-${number}`;
16
+ readonly roomIds: readonly `room-${number}`[];
17
+ readonly summary: string;
18
+ readonly startsAt: Temporal.Instant;
19
+ readonly endsAt: Temporal.Instant;
20
+ readonly updatedAt: string;
21
+ readonly locked: boolean;
22
+ }
23
+
24
+ interface Room {
25
+ readonly id: `room-${number}`;
26
+ readonly name: string;
27
+ }
28
+
29
+ const bookingAdapter = defineEventAdapter<Booking>()({
30
+ getId: (booking) => booking.id,
31
+ getTitle: (booking) => booking.summary,
32
+ getInterval: (booking) => ({ kind: "timed", start: booking.startsAt, end: booking.endsAt }),
33
+ getResourceIds: (booking) => booking.roomIds,
34
+ getRevision: (booking) => booking.updatedAt,
35
+ isReadOnly: (booking) => booking.locked,
36
+ });
37
+
38
+ export const BookingCalendar = createCalendar<Booking, Room>()({ eventAdapter: bookingAdapter });
39
+ ```
40
+
41
+ `defineEventAdapter<Booking>()` is called twice on purpose. The first call fixes the record type,
42
+ and the second infers the ID types from your accessors. Here `booking-${number}` stays
43
+ `booking-${number}` everywhere Time hands an ID back to you, so you never cast.
44
+
45
+ `getRevision`, `isReadOnly` and `isBusy` are optional. The [adapter reference](../api/events.md#adapter)
46
+ lists every field.
47
+
48
+ ## Time ranges
49
+
50
+ `getInterval` returns one of three kinds of range. Pick the one that matches what the event means:
51
+
52
+ | `kind` | `start` and `end` | Use it for |
53
+ | ------------ | ------------------------ | --------------------------------------------------------------- |
54
+ | `"timed"` | `Temporal.Instant` | Meetings and calls: exact moments, shown in the calendar's zone |
55
+ | `"all-day"` | `Temporal.PlainDate` | Holidays and vacations: whole dates, the same in every zone |
56
+ | `"floating"` | `Temporal.PlainDateTime` | Wall-clock times with no zone, like "gym at 7:00" |
57
+
58
+ The end is always exclusive. A one-day all-day event on October 8 has `end` set to October 9.
59
+ [Time and time zones](./time.md) covers this in detail.
60
+
61
+ ## IDs
62
+
63
+ Event and resource IDs are non-empty strings or finite numbers. To check untrusted input before
64
+ it reaches the calendar, use `isEventId` and `isResourceId`:
65
+
66
+ ```ts
67
+ import { isEventId } from "@moltenship/calendar";
68
+
69
+ isEventId("booking-12"); // true
70
+ isEventId(""); // false
71
+ isEventId(Number.NaN); // false
72
+ ```
73
+
74
+ ## Resources
75
+
76
+ Resources are what events are assigned to: rooms, people, equipment. Pass your own resource records
77
+ (anything with an `id`) to `Root` as `resources`, and return their IDs from `getResourceIds`. An
78
+ event can belong to no resource, one, or several.
79
+
80
+ Views can then filter by resource with `snapshot.eventsForResource(roomId)` or
81
+ `snapshot.queryTimed(range, { resourceIds: [roomId] })`. See [snapshot queries](../api/events.md#queries).
82
+
83
+ ## Changing events
84
+
85
+ Time never edits, saves, or fetches your events. When your data changes, update your own state and
86
+ pass a new array. To fetch only the dates on screen, load the `loadRange` that
87
+ [`onVisibleRangeChange`](../views/scrolling.md#loading-events-as-you-scroll) reports.
88
+
89
+ Treat your records as immutable: change a record by replacing it with a new object. Time compares
90
+ the array item by item, so a new array with the same records in the same order counts as unchanged,
91
+ even if you build it inline with `filter` or `map`. When the array does change, Time reads every record again
92
+ through the adapter; if every record comes out the same, in the same order, it keeps its interval indexes. With
93
+ `getRevision`, a record whose revision is unchanged is skipped after `getId` and `getRevision`. The [performance guide](../guides/performance.md)
94
+ explains how to make the most of that.
95
+
96
+ ## Events from an external store
97
+
98
+ `events` also takes a **source**: an object with `getSnapshot`, `getServerSnapshot` and
99
+ `subscribe`, the shape React's `useSyncExternalStore` reads. Use one when your events live outside
100
+ React and change often, as in a store a websocket or a sync engine updates, or a Zustand-like
101
+ store. `Root` subscribes to the source itself, so an update renders the calendar, not the component
102
+ that renders `Root`. With a Zustand store:
103
+
104
+ ```tsx
105
+ import type { CalendarEventSource } from "@moltenship/calendar";
106
+
107
+ // At module scope, so the source stays the same object.
108
+ const bookingSource: CalendarEventSource<Booking> = {
109
+ getSnapshot: () => useBookings.getState().bookings,
110
+ getServerSnapshot: () => useBookings.getInitialState().bookings,
111
+ subscribe: useBookings.subscribe,
112
+ };
113
+
114
+ <BookingCalendar.Root events={bookingSource} {...otherProps} />;
115
+ ```
116
+
117
+ - `getSnapshot` returns the same array until the events change. Don't filter or map inside it: a
118
+ new array on every call looks like a change every time, and React renders in a loop.
119
+ - `getServerSnapshot` returns the events the server rendered with. The server and hydration read
120
+ it, then `Root` shows `getSnapshot`'s events and subscribes. Without server rendering, return the
121
+ store's initial events.
122
+ - Keep the source stable, at module scope or in `useState`. A new source object subscribes again.
123
+
124
+ Everything else works as with an array: records are compared item by item and read through your
125
+ adapter, a saved change stays [pending](../interactions.md#pending-changes) until the source's
126
+ events next change, and you can switch between an array and a source. A busy source changes
127
+ often, so write a saved change into the store before your handler's promise resolves: otherwise
128
+ the source's next update, even one about other events, decides where the event is. React renders a source's
129
+ updates right away, as it does for any external store; to update in a transition, keep the events
130
+ in state and pass the array.
131
+
132
+ ## Invalid records
133
+
134
+ By default, an invalid record is skipped and reported. The rest of the calendar keeps working.
135
+ Reasons include a missing or duplicate ID, an end that isn't after the start, a range of the wrong
136
+ Temporal type, or an adapter function that throws.
137
+
138
+ Reports show up in `meta.diagnostics` and in the `onDiagnosticsChange` callback on `Root`:
139
+
140
+ ```tsx title="bookings.tsx"
141
+ export function reportDiagnostics(
142
+ diagnostics: readonly CalendarDiagnostic<Booking, Booking["id"]>[],
143
+ ) {
144
+ for (const diagnostic of diagnostics) {
145
+ if (diagnostic.code === "invalid-event") {
146
+ console.warn(`Skipped event #${diagnostic.issue.index}: ${diagnostic.issue.code}`);
147
+ }
148
+ }
149
+ }
150
+
151
+ ```
152
+
153
+ Pass `reportDiagnostics` as `onDiagnosticsChange`. Time calls it after mount and again whenever the
154
+ list changes; an inline function works too.
155
+
156
+ To reject bad input instead, pass `invalidEventPolicy: "throw"` to `createCalendar`.
157
+ Time then throws an `InvalidCalendarEventSnapshotError` during render, with every problem listed on
158
+ its `issues` property. Catch it with an error boundary.
159
+
160
+ ## Records in Time's own shape
161
+
162
+ If you're starting from scratch, you can store events in Time's built-in shape (`CalendarEvent`: an
163
+ `id`, `title`, `kind`, `start`, `end`, optional `resourceIds`, and your own `data`) and use
164
+ `createCanonicalEventAdapter()` instead of writing an adapter.