@moltenship/calendar 2.0.0-beta.1 → 2.0.0
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.
- package/README.md +11 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/docs/accessibility.md +5 -4
- package/docs/agents/changes.md +3 -3
- package/docs/agents/coding-agents.md +19 -20
- package/docs/agents/connect.md +20 -11
- package/docs/agents/deleting.md +2 -2
- package/docs/agents/reference.md +5 -6
- package/docs/agents/server.md +4 -4
- package/docs/agents/webmcp.md +2 -2
- package/docs/agents.md +10 -8
- package/docs/annotations.md +10 -8
- package/docs/api/changes.md +37 -21
- package/docs/api/{react.md → components.md} +65 -56
- package/docs/api/dnd-kit.md +1 -3
- package/docs/api/events.md +14 -13
- package/docs/api/primitives.md +61 -11
- package/docs/api/store.md +3 -3
- package/docs/api.md +23 -23
- package/docs/availability.md +25 -22
- package/docs/comparison.md +23 -24
- package/docs/concepts/anatomy.md +3 -3
- package/docs/concepts/events.md +2 -3
- package/docs/concepts/how-it-works.md +33 -16
- package/docs/concepts/state.md +1 -1
- package/docs/concepts/time.md +5 -7
- package/docs/customization.md +271 -0
- package/docs/frameworks.md +116 -0
- package/docs/guides/dnd-kit.md +2 -2
- package/docs/guides/google-calendar-sync.md +3 -3
- package/docs/guides/google-calendar.md +4 -4
- package/docs/guides/motion.md +2 -2
- package/docs/guides/nextjs-app-router.md +1 -1
- package/docs/guides/nextjs.md +1 -1
- package/docs/guides/performance.md +6 -6
- package/docs/guides/tanstack-query.md +2 -2
- package/docs/{guides/ics.md → ics/feed.md} +7 -9
- package/docs/ics/import.md +183 -0
- package/docs/{api/ics.md → ics/reference.md} +11 -53
- package/docs/ics.md +142 -0
- package/docs/index.md +81 -50
- package/docs/installation.md +48 -33
- package/docs/interactions.md +36 -3
- package/docs/llms.txt +81 -68
- package/docs/migrating-to-2.md +200 -25
- package/docs/quick-start.md +27 -23
- package/docs/{guides/recurring-events.md → recurrence/calendar.md} +23 -8
- package/docs/{concepts/recurrence.md → recurrence/model.md} +13 -12
- package/docs/{api/recurrence.md → recurrence/reference.md} +22 -61
- package/docs/recurrence.md +122 -0
- package/docs/stylex.md +74 -49
- package/docs/temporal/daylight-saving-time.md +172 -0
- package/docs/temporal/month-grid.md +119 -0
- package/docs/{api/temporal.md → temporal/reference.md} +7 -12
- package/docs/temporal.md +105 -0
- package/docs/testing.md +20 -1
- package/docs/theme-builder.md +9 -8
- package/docs/theming.md +108 -2
- package/docs/undo-redo.md +24 -16
- package/docs/views/agenda.md +14 -13
- package/docs/views/custom-views.md +13 -10
- package/docs/views/month.md +10 -9
- package/docs/views/resource-columns.md +21 -17
- package/docs/views/resource-timeline.md +16 -15
- package/docs/views/scrolling.md +7 -6
- package/docs/views/week-and-day.md +15 -14
- package/docs/views/year.md +11 -11
- package/docs/views.md +1 -1
- package/package.json +7 -6
- package/skills/moltenship-time/SKILL.md +7 -5
- package/skills/moltenship-time/references/compose.md +13 -6
- package/skills/moltenship-time/references/mistakes.md +4 -2
- package/skills/moltenship-time/references/solid.md +36 -25
- package/docs/api/solid.md +0 -460
package/docs/availability.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Working hours, closed days and holidays, people and rooms in their own time zones, shading you can restyle, a busy or free status, and policies that keep bookings inside working hours and rooms from being double-booked.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/availability
|
|
5
|
+
Source: https://time.molten.sh/docs/react/availability
|
|
6
6
|
|
|
7
|
-
> Live example of the `week` view: see it at https://time.molten.sh/docs/availability
|
|
7
|
+
> Live example of the `week` view: see it at https://time.molten.sh/docs/react/availability
|
|
8
8
|
|
|
9
9
|
Business hours are open, and everything else is shaded: the evenings, the weekend and Friday's
|
|
10
10
|
holiday. Availability is when the calendar, or a person or a room, can be booked. Views shade the
|
|
@@ -61,7 +61,7 @@ as `invalid-availability`. The calendar never throws over them.
|
|
|
61
61
|
|
|
62
62
|
## People and rooms
|
|
63
63
|
|
|
64
|
-
> Live example of the `resources` view: see it at https://time.molten.sh/docs/availability
|
|
64
|
+
> Live example of the `resources` view: see it at https://time.molten.sh/docs/react/availability
|
|
65
65
|
|
|
66
66
|
Resources follow the calendar's hours unless they have their own:
|
|
67
67
|
|
|
@@ -90,11 +90,12 @@ const resources = [
|
|
|
90
90
|
calendar's, so a company holiday closes every room, and the resource's own win on the same date.
|
|
91
91
|
- **Own time zone.** A resource with a `timeZone` keeps its hours on that clock: Alex's 9 to 5 in
|
|
92
92
|
Los Angeles shows as the evening in Berlin.
|
|
93
|
+
- **The same instant.** Moving an event to a resource in another time zone keeps its instant: a
|
|
94
|
+
9:00 call in New York stays 9:00 in New York, which is 14:00 for London.
|
|
95
|
+
|
|
93
96
|
- **One time axis.** Resource columns and the timeline keep a single axis in the display time
|
|
94
97
|
zone. Only the shading follows each resource's clock, and its header shows its local time and
|
|
95
98
|
UTC offset, such as "7:18 AM GMT-7", while that clock differs from the display time zone's.
|
|
96
|
-
- **The same instant.** Moving an event to a resource in another time zone keeps its instant: a
|
|
97
|
-
9:00 call in New York stays 9:00 in New York, which is 14:00 for London.
|
|
98
99
|
|
|
99
100
|
## Customize the shading
|
|
100
101
|
|
|
@@ -109,7 +110,7 @@ where it meets open time, so CSS can restyle it:
|
|
|
109
110
|
| `data-opens-before`, `data-opens-after` | Present where open time meets the band's start or end in the view |
|
|
110
111
|
| `--band-start`, `--band-end` | Where the band starts and ends along its column or row, as percentages |
|
|
111
112
|
|
|
112
|
-
> Live example: see it at https://time.molten.sh/docs/availability
|
|
113
|
+
> Live example: see it at https://time.molten.sh/docs/react/availability
|
|
113
114
|
|
|
114
115
|
```css title="globals.css"
|
|
115
116
|
/* Gradient: closed time fades out over the last hour and a half before working hours. */
|
|
@@ -156,11 +157,12 @@ days in the month. In the dark theme closed time is lighter than open time, sinc
|
|
|
156
157
|
surface has little room to get darker. Recipes built on `--muted-foreground` or your own tokens
|
|
157
158
|
follow the theme the same way.
|
|
158
159
|
|
|
159
|
-
To draw something else, pass `renderUnavailable` to a view
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
To draw something else, pass `renderUnavailable` to a view: a function of the band's props and its
|
|
161
|
+
state that returns an element. The state holds the `band` (its `reason`, `label` and edges), the
|
|
162
|
+
column's `date` and the `resource` whose hours it shows, or `null` for the calendar's own. Keep the
|
|
163
|
+
props on your element: they place it and keep it hidden from screen readers.
|
|
164
|
+
|
|
165
|
+
Rooms can look different from people:
|
|
164
166
|
|
|
165
167
|
```tsx
|
|
166
168
|
import type { UnavailableTimeRender } from "@/components/calendar/unavailable-time";
|
|
@@ -237,7 +239,7 @@ function Presence({ id }: { id: string }) {
|
|
|
237
239
|
|
|
238
240
|
## Busy badge in resource views
|
|
239
241
|
|
|
240
|
-
> Live example of the `resources` view: see it at https://time.molten.sh/docs/availability
|
|
242
|
+
> Live example of the `resources` view: see it at https://time.molten.sh/docs/react/availability
|
|
241
243
|
|
|
242
244
|
Set `resourceStatus: true` on the resource columns or timeline view to show a badge on each
|
|
243
245
|
resource:
|
|
@@ -251,8 +253,9 @@ resource:
|
|
|
251
253
|
|
|
252
254
|
The words carry the state; the dot before them is colored with `--calendar-busy` or
|
|
253
255
|
`--calendar-free`. Times are on the display clock, with the weekday within the next six days and the date further out. Busy
|
|
254
|
-
wins over the hours, so a late call shows as busy. The badge is
|
|
255
|
-
|
|
256
|
+
wins over the hours, so a late call shows as busy. The badge is the calendar's `Badge`.
|
|
257
|
+
|
|
258
|
+
In your own `ResourceHeader`, add `ResourceHeaderStatus` where you want it:
|
|
256
259
|
|
|
257
260
|
```tsx
|
|
258
261
|
import {
|
|
@@ -282,7 +285,7 @@ view gets in its props.
|
|
|
282
285
|
|
|
283
286
|
## Scheduling: who's busy?
|
|
284
287
|
|
|
285
|
-
> Live example of the `timeline-day` view: see it at https://time.molten.sh/docs/availability
|
|
288
|
+
> Live example of the `timeline-day` view: see it at https://time.molten.sh/docs/react/availability
|
|
286
289
|
|
|
287
290
|
While you place an event, by dragging or with the keyboard, each resource's header says whether
|
|
288
291
|
it's busy then: **Busy** when an event overlaps the draft, **Outside hours** when the time is
|
|
@@ -370,7 +373,6 @@ createTimelineWeekView<Meeting>({
|
|
|
370
373
|
},
|
|
371
374
|
});
|
|
372
375
|
```
|
|
373
|
-
|
|
374
376
|
**Your own idea of busy.** The event adapter's `isBusy` is the one place that decides, for the
|
|
375
377
|
status, the draft headers, `busyResources` and `conflictPolicy` alike:
|
|
376
378
|
|
|
@@ -417,10 +419,11 @@ function RoomPicker({ interval, eventId }: { interval: CalendarEventInterval; ev
|
|
|
417
419
|
`conflictPolicy` in the root's `policies` checks a change against double-booking: a busy event
|
|
418
420
|
may not overlap another busy event of a resource it books. It runs the same query as
|
|
419
421
|
`busyResources`, with the reason `"resource-conflict"`. Each resource can follow its own mode, so a
|
|
420
|
-
room can't be double-booked while a person can, with a warning.
|
|
421
|
-
here, and switch the modes:
|
|
422
|
+
room can't be double-booked while a person can, with a warning.
|
|
422
423
|
|
|
423
|
-
|
|
424
|
+
Drag a booking onto another one here, and switch the modes:
|
|
425
|
+
|
|
426
|
+
> Live example: see it at https://time.molten.sh/docs/react/availability
|
|
424
427
|
|
|
425
428
|
```tsx
|
|
426
429
|
import { conflictPolicy } from "@moltenship/calendar";
|
|
@@ -453,8 +456,8 @@ const policies = [
|
|
|
453
456
|
queried at all, and deletes always pass.
|
|
454
457
|
- Events that only touch don't conflict, and an event that isn't busy books nothing: the event
|
|
455
458
|
adapter's [`isBusy`](#busy-or-available) decides, for `conflictPolicy` as for the status.
|
|
456
|
-
- The modes decide what saving does, not who's busy. A person in `"allow"` mode still shows as busy
|
|
457
|
-
|
|
459
|
+
- The modes decide what saving does, not who's busy. A person in `"allow"` mode still shows as busy in the [badge](#busy-badge-in-resource-views) and while you place an event.
|
|
460
|
+
|
|
458
461
|
- Previews follow the modes: dragging a meeting over a busy room that blocks marks the preview red,
|
|
459
462
|
and over a busy person who warns, amber. See [keep changes inside](#keep-changes-inside).
|
|
460
463
|
|
|
@@ -520,7 +523,7 @@ The messages live in `components/calendar/announcements.ts` in your app, ready t
|
|
|
520
523
|
|
|
521
524
|
## Anatomy
|
|
522
525
|
|
|
523
|
-
> Diagram: see it at https://time.molten.sh/docs/availability
|
|
526
|
+
> Diagram: see it at https://time.molten.sh/docs/react/availability
|
|
524
527
|
|
|
525
528
|
```txt title="Rendered by TimeGridColumn"
|
|
526
529
|
TimeGridColumn time-grid-column.tsx
|
package/docs/comparison.md
CHANGED
|
@@ -2,23 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
How Time compares with FullCalendar and react-big-calendar, as of October 2026.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/comparison
|
|
5
|
+
Source: https://time.molten.sh/docs/react/comparison
|
|
6
6
|
|
|
7
|
-
This page compares Time with two React calendars that many teams already use:
|
|
7
|
+
This page compares Time in a React app with two React calendars that many teams already use:
|
|
8
8
|
[FullCalendar](https://fullcalendar.io) 7.1, through `@fullcalendar/react` and its premium
|
|
9
9
|
plugins, and [react-big-calendar](https://github.com/bigcalendar/react-big-calendar) 1.20. It's
|
|
10
|
-
accurate as of **October 2026
|
|
10
|
+
accurate as of **October 2026**, and Time's rows under [Maturity](#maturity) as of November 25, 2026. Claims about Time come from these docs and the code on `main`.
|
|
11
11
|
Claims about the other two link their sources in the notes at the end of the page; a ✗ without a
|
|
12
12
|
note means we found no such feature in their docs or code. If something here is wrong or out of
|
|
13
13
|
date, [open an issue](https://github.com/Moltenship/time/issues).
|
|
14
14
|
|
|
15
|
-
> **Time is new
|
|
15
|
+
> **Time is new**
|
|
16
16
|
>
|
|
17
|
-
> Time started in August 2026 and has one maintainer.
|
|
18
|
-
>
|
|
19
|
-
>
|
|
20
|
-
>
|
|
21
|
-
> rows below with that in mind.
|
|
17
|
+
> Time started in August 2026 and has one maintainer. This page compares its React package; the
|
|
18
|
+
> SolidJS 2 one has the same engine and views, in Tailwind CSS. FullCalendar has been developed
|
|
19
|
+
> since 2009 and react-big-calendar since 2015. Both are downloaded more than a million times a week
|
|
20
|
+
> and run in production in many apps. Read the rows below with that in mind.
|
|
22
21
|
|
|
23
22
|
**✓** means built in. **Partial** means it's there, with the limit the note gives. **✗** means
|
|
24
23
|
it isn't built in: you'd write it yourself or add another library.
|
|
@@ -80,9 +79,9 @@ it isn't built in: you'd write it yourself or add another library.
|
|
|
80
79
|
|
|
81
80
|
| | Time | FullCalendar | react-big-calendar |
|
|
82
81
|
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
83
|
-
| Recurring events | ✓ `@moltenship/calendar-recurrence`: RRULE, EXDATE and RDATE, overrides, and cancelled occurrences ([Recurring events](./
|
|
84
|
-
| Edit this, following or all | ✓ A scope dialog, and `resolveRecurrenceEdit` works out what to save ([guide](./
|
|
85
|
-
| ICS import | ✓ `@moltenship/ics` parses RFC 5545 into Temporal values, with Windows zone names and line-numbered issues ([ICS](./
|
|
82
|
+
| Recurring events | ✓ `@moltenship/calendar-recurrence`: RRULE, EXDATE and RDATE, overrides, and cancelled occurrences ([Recurring events](./recurrence/model.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] |
|
|
83
|
+
| Edit this, following or all | ✓ A scope dialog, and `resolveRecurrenceEdit` works out what to save ([guide](./recurrence/calendar.md)) | ✗ Not in the docs. `groupId` moves occurrences together[^fc-rrule] | ✗ |
|
|
84
|
+
| ICS import | ✓ `@moltenship/ics` parses RFC 5545 into Temporal values, with Windows zone names and line-numbered issues ([ICS](./ics/reference.md)) | ✓ The `icalendar` plugin loads a feed URL when the calendar loads, and again on `refetchEvents`[^fc-ics] | ✗ |
|
|
86
85
|
| ICS export | Partial. `stringifyIcsComponents` writes a syntax tree you build. No writer from typed events yet | ✗ Not in the docs[^fc-ics] | ✗ |
|
|
87
86
|
| 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
87
|
| Busy status | ✓ Busy and unavailable kept apart, with `busyAt`, `resourceStatusAt` and a busy badge | ✗ | ✗ |
|
|
@@ -94,7 +93,7 @@ it isn't built in: you'd write it yourself or add another library.
|
|
|
94
93
|
| | Time | FullCalendar | react-big-calendar |
|
|
95
94
|
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
96
95
|
| 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
|
|
96
|
+
| Frameworks | React and SolidJS 2: the same headless calendar, keyboard navigation and dragging, and the registry's styled views in both ([React and Solid](./frameworks.md)) | ✓ React, Vue 3, Angular, Preact, plain JavaScript and a web component[^fc-frameworks] | React only[^rbc-react] |
|
|
98
97
|
| React versions | 19 | 17 to 19[^fc-frameworks] | 16.14 to 19[^rbc-react] |
|
|
99
98
|
| 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
99
|
| 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] | ✗ |
|
|
@@ -106,7 +105,7 @@ it isn't built in: you'd write it yourself or add another library.
|
|
|
106
105
|
| | Time | FullCalendar | react-big-calendar |
|
|
107
106
|
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
108
107
|
| 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
|
|
108
|
+
| Bundle size, gzipped | Measured on 1.x, before 2.0 added ui-sdk. 143 kB, or 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
109
|
|
|
111
110
|
### How the sizes were measured
|
|
112
111
|
|
|
@@ -142,14 +141,14 @@ polyfill, which only browsers without Temporal need.
|
|
|
142
141
|
|
|
143
142
|
## Maturity
|
|
144
143
|
|
|
145
|
-
| | Time
|
|
146
|
-
| ------------------------------ |
|
|
147
|
-
| Since | August 2026
|
|
148
|
-
| Latest release |
|
|
149
|
-
| Releases in the last 12 months |
|
|
150
|
-
| Weekly npm downloads |
|
|
151
|
-
| GitHub | 1 contributor
|
|
152
|
-
| Support | GitHub issues
|
|
144
|
+
| | Time | FullCalendar | react-big-calendar |
|
|
145
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------- |
|
|
146
|
+
| Since | August 2026 | 2009[^fc-maturity] | 2015[^rbc-maturity] |
|
|
147
|
+
| Latest release | 2.0.0-beta.1, a pre-release, November 25, 2026 | 7.1.2, October 12, 2026[^fc-maturity] | 1.20.0, June 1, 2026[^rbc-maturity] |
|
|
148
|
+
| Releases in the last 12 months | 3: two release candidates and one beta | 8[^fc-maturity] | 2[^rbc-maturity] |
|
|
149
|
+
| Weekly npm downloads | 9 for `@moltenship/calendar` in the week of November 17, 2026. First published in October 2026 | 1.8 million for `@fullcalendar/react`[^fc-downloads] | 1.17 million[^rbc-downloads] |
|
|
150
|
+
| GitHub | 1 contributor | 20.7k stars, about 130 contributors[^fc-maturity] | 8.8k stars, about 240 contributors[^rbc-maturity] |
|
|
151
|
+
| Support | GitHub issues | Community support, and email support with a premium license[^fc-license] | GitHub issues[^rbc-maturity] |
|
|
153
152
|
|
|
154
153
|
FullCalendar and react-big-calendar have years of bug reports behind them, answers on Stack
|
|
155
154
|
Overflow, example projects and people who know them. Time has none of that yet.
|
|
@@ -167,12 +166,12 @@ drag and drop, and you don't need a year view, a timeline, keyboard editing, rec
|
|
|
167
166
|
time zones beyond a localizer's default. It had two releases in the last twelve months, so expect
|
|
168
167
|
fixes to come slowly.
|
|
169
168
|
|
|
170
|
-
**Time** if you're on React 19
|
|
169
|
+
**Time** if you're on React 19, and you want Temporal from end to
|
|
171
170
|
end, view components you own as source, editing by keyboard with screen reader announcements,
|
|
172
171
|
edits to recurring series, availability and conflict rules, resource views under the MIT license,
|
|
173
172
|
or a calendar an [AI agent](./agents.md) can read and change under your app's rules. Don't choose
|
|
174
173
|
it yet if you need a stable release with a track record, or styled views for a framework other
|
|
175
|
-
than React.
|
|
174
|
+
than React and Solid.
|
|
176
175
|
|
|
177
176
|
[^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
177
|
|
package/docs/concepts/anatomy.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
The parts a calendar is built from, and their names in code.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/concepts/anatomy
|
|
5
|
+
Source: https://time.molten.sh/docs/react/concepts/anatomy
|
|
6
6
|
|
|
7
7
|
A calendar is made of the parts your `createCalendar` factory returns, such as `Calendar.Toolbar`,
|
|
8
8
|
and a few components from the registry. The diagram labels each part with its name in code, and the
|
|
9
9
|
code below it puts the same parts together.
|
|
10
10
|
|
|
11
|
-
> Diagram: see it at https://time.molten.sh/docs/concepts/anatomy
|
|
11
|
+
> Diagram: see it at https://time.molten.sh/docs/react/concepts/anatomy
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
14
|
<Calendar.Root
|
|
@@ -46,7 +46,7 @@ code below it puts the same parts together.
|
|
|
46
46
|
works anywhere inside it.
|
|
47
47
|
- **`Frame`, `Toolbar`, `Title`, `Viewport`,** and the three triggers each render one element with a
|
|
48
48
|
`data-calendar-part` attribute, such as `data-calendar-part="today-trigger"`, for styling. The
|
|
49
|
-
[component reference](../api/
|
|
49
|
+
[component reference](../api/components.md#components) lists them.
|
|
50
50
|
- **`ActiveView`** renders the active view's Renderer inside the viewport.
|
|
51
51
|
- **`ViewSwitcher`** and **`MiniMonth`** come from `registry/calendar`. They're plain components:
|
|
52
52
|
you connect them to the calendar with `setView`, `setAnchorDate`, and the `view` and
|
package/docs/concepts/events.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
How Time reads your event records, and what happens when one is invalid.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/concepts/events
|
|
5
|
+
Source: https://time.molten.sh/docs/react/concepts/events
|
|
6
6
|
|
|
7
7
|
Time has no event class of its own. You pass an array of your own records to `Root`, and an
|
|
8
8
|
**adapter** tells Time how to read each one: its ID, title, time range, and the resources it belongs
|
|
@@ -83,8 +83,7 @@ Views can then filter by resource with `snapshot.eventsForResource(roomId)` or
|
|
|
83
83
|
## Changing events
|
|
84
84
|
|
|
85
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.
|
|
86
|
+
pass a new array. To fetch only the dates on screen, load the `loadRange` that [`onVisibleRangeChange`](../views/scrolling.md#loading-events-as-you-scroll) reports.
|
|
88
87
|
|
|
89
88
|
Treat your records as immutable: change a record by replacing it with a new object. Time compares
|
|
90
89
|
the array item by item, so a new array with the same records in the same order counts as unchanged,
|
|
@@ -1,21 +1,38 @@
|
|
|
1
1
|
# How it works
|
|
2
2
|
|
|
3
|
-
The packages, and how your events become a rendered view.
|
|
3
|
+
The packages, which of them React and Solid share, and how your events become a rendered view.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/concepts/how-it-works
|
|
5
|
+
Source: https://time.molten.sh/docs/react/concepts/how-it-works
|
|
6
6
|
|
|
7
7
|
## Packages
|
|
8
8
|
|
|
9
|
+
Time has three layers. The engine and the calendar import no UI framework, and an integration
|
|
10
|
+
renders them in one:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
integration @moltenship/calendar (React) @moltenship/calendar-solid (Solid)
|
|
14
|
+
calendar @moltenship/calendar-primitives state, actions, what an agent can call
|
|
15
|
+
engine @moltenship/calendar-core adapters, validation, snapshots, queries, changes
|
|
16
|
+
@moltenship/calendar-temporal ranges, day boundaries, DST helpers
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
A React app imports one package, which re-exports the React integration and the layers under it:
|
|
20
|
+
|
|
9
21
|
```text
|
|
10
|
-
@moltenship/calendar what
|
|
11
|
-
├── @moltenship/calendar-react Root, components, hooks
|
|
22
|
+
@moltenship/calendar what a React app imports: everything below
|
|
23
|
+
├── @moltenship/calendar-react the React integration: Root, components, hooks
|
|
12
24
|
│ └── @moltenship/calendar-primitives the calendar without a framework: state, actions, agents
|
|
13
25
|
├── @moltenship/calendar-dnd drag, resize, and create inside views
|
|
14
26
|
├── @moltenship/calendar-core adapters, validation, snapshots, queries, changes
|
|
15
27
|
└── @moltenship/calendar-temporal ranges, day boundaries, DST helpers
|
|
16
28
|
```
|
|
17
29
|
|
|
18
|
-
|
|
30
|
+
A Solid app imports `@moltenship/calendar-solid` and `@moltenship/calendar-core`. The Solid
|
|
31
|
+
integration has [docs of its own](https://time.molten.sh/docs/solid.md), and
|
|
32
|
+
[React and Solid](../frameworks.md) lists what it has.
|
|
33
|
+
|
|
34
|
+
`calendar-dnd` builds on `calendar-core`, which builds on `calendar-temporal`, and `calendar-react`
|
|
35
|
+
builds on all three and on `calendar-primitives`.
|
|
19
36
|
`calendar-core` and `calendar-temporal` don't use React or the DOM, so they also run on a server
|
|
20
37
|
or in a worker.
|
|
21
38
|
|
|
@@ -32,16 +49,16 @@ Two more packages stand apart from `@moltenship/calendar`: `@moltenship/calendar
|
|
|
32
49
|
recurring events into ordinary events (it builds on core, Temporal and `ics`), and `@moltenship/ics`
|
|
33
50
|
parses iCalendar text with no dependencies.
|
|
34
51
|
|
|
35
|
-
| Package | Use it when
|
|
36
|
-
| --------------------------------- |
|
|
37
|
-
| `@moltenship/calendar` |
|
|
38
|
-
| `@moltenship/calendar-core` | You
|
|
39
|
-
| `@moltenship/calendar-temporal` | You only need the date and time zone helpers.
|
|
40
|
-
| `@moltenship/calendar-react` | Rarely. `@moltenship/calendar` already includes everything in it.
|
|
41
|
-
| `@moltenship/calendar-primitives` | You write a framework integration, or want the agent types. See [Primitives](../api/primitives.md).
|
|
42
|
-
| `@moltenship/calendar-solid` | Your app is on SolidJS 2.
|
|
43
|
-
| `@moltenship/calendar-recurrence` | Your events repeat. See [Recurring events](
|
|
44
|
-
| `@moltenship/ics` | You read iCalendar feeds or files. See [ICS](../
|
|
52
|
+
| Package | Use it when |
|
|
53
|
+
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| `@moltenship/calendar` | Your app is on React. It includes `calendar-core`, `calendar-temporal`, `calendar-react` and `calendar-dnd`. |
|
|
55
|
+
| `@moltenship/calendar-core` | You validate or query events in code that loads no framework. |
|
|
56
|
+
| `@moltenship/calendar-temporal` | You only need the date and time zone helpers. |
|
|
57
|
+
| `@moltenship/calendar-react` | Rarely. `@moltenship/calendar` already includes everything in it. |
|
|
58
|
+
| `@moltenship/calendar-primitives` | You write a framework integration, or want the agent types. See [Primitives](../api/primitives.md). |
|
|
59
|
+
| `@moltenship/calendar-solid` | Your app is on SolidJS 2. It includes `calendar-core`, `calendar-temporal` and the pointer helpers of `calendar-dnd`. See the [Solid docs](https://time.molten.sh/docs/solid.md). |
|
|
60
|
+
| `@moltenship/calendar-recurrence` | Your events repeat. See [Recurring events](../recurrence/model.md). |
|
|
61
|
+
| `@moltenship/ics` | You read iCalendar feeds or files. See [ICS](../ics/reference.md). |
|
|
45
62
|
|
|
46
63
|
`@moltenship/calendar` has no `"use client"` directive of its own, so a Server Component can import
|
|
47
64
|
its core and Temporal helpers. The React parts and the pointer layer keep their client boundary.
|
|
@@ -69,7 +86,7 @@ Steps 2 and 3 only run again when their inputs change. A new array with the same
|
|
|
69
86
|
order reuses the snapshot. A changed array is read again through the adapter, except records with an
|
|
70
87
|
unchanged `getRevision` value; if every record comes out the same, in the same order, the interval indexes are kept.
|
|
71
88
|
|
|
72
|
-
## Using the engine without
|
|
89
|
+
## Using the engine without a framework
|
|
73
90
|
|
|
74
91
|
Snapshots work anywhere. This finds the meetings in a time range using `calendar-core` and
|
|
75
92
|
`calendar-temporal` directly:
|
package/docs/concepts/state.md
CHANGED
package/docs/concepts/time.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Timed, all-day, and floating events, exclusive end times, and daylight saving time.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/concepts/time
|
|
5
|
+
Source: https://time.molten.sh/docs/react/concepts/time
|
|
6
6
|
|
|
7
7
|
Time uses the
|
|
8
8
|
[Temporal API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal)
|
|
@@ -86,7 +86,7 @@ converts that moment to the other zone. It never adds a fixed offset, so the lab
|
|
|
86
86
|
the days either zone changes its clocks, and for zones such as Australia/Lord_Howe, whose clocks
|
|
87
87
|
move by 30 minutes. Like `timeZone`, the list is an explicit input, so the server and the browser
|
|
88
88
|
render the same labels. Invalid zones are left out and reported as
|
|
89
|
-
[diagnostics](../api/
|
|
89
|
+
[diagnostics](../api/components.md#diagnostics).
|
|
90
90
|
|
|
91
91
|
A grid has one hour gutter for all its days, so the gutter follows one of them: the first day shown
|
|
92
92
|
on which neither zone changes its clocks. The days whose lines read differently, because a zone
|
|
@@ -127,8 +127,7 @@ Temporal.PlainDateTime.from("2026-03-29T02:30")
|
|
|
127
127
|
`Root`'s `disambiguation` prop takes the same values (default `"compatible"`) and gives the setting
|
|
128
128
|
to views as `environment.disambiguation`. The built-in views and interactions don't read it; use it
|
|
129
129
|
in your own view when you turn a wall-clock time into an instant. When you build a view, these
|
|
130
|
-
helpers from
|
|
131
|
-
`@moltenship/calendar` already account for these days:
|
|
130
|
+
helpers from `@moltenship/calendar` already account for these days:
|
|
132
131
|
|
|
133
132
|
- `zonedDayRange(date, timeZone)` returns the real start and end of a day, 23 or 25 hours long when
|
|
134
133
|
needed.
|
|
@@ -136,7 +135,7 @@ helpers from
|
|
|
136
135
|
- `resolveZonedWallTime(wallTime, { timeZone, disambiguation })` tells you how a wall-clock time
|
|
137
136
|
resolved, including how far it moved.
|
|
138
137
|
|
|
139
|
-
See the [Temporal helpers reference](../
|
|
138
|
+
See the [Temporal helpers reference](../temporal/reference.md).
|
|
140
139
|
|
|
141
140
|
## The current time
|
|
142
141
|
|
|
@@ -152,8 +151,7 @@ Without `now`, nothing that depends on the current time renders on the server: a
|
|
|
152
151
|
`null` and `useNow()` returns `null` until the page has hydrated. The Today button always works; it
|
|
153
152
|
reads the clock when it's clicked.
|
|
154
153
|
|
|
155
|
-
`useNow()` gives a component the current instant, for example to draw a line at the current time.
|
|
156
|
-
It re-renders every `intervalMs` (one minute by default). This one uses the `Calendar` from the
|
|
154
|
+
`useNow()` gives a component the current instant, for example to draw a line at the current time. It re-renders every `intervalMs` (one minute by default). This one uses the `Calendar` from the
|
|
157
155
|
[Quick start](../quick-start.md):
|
|
158
156
|
|
|
159
157
|
```tsx
|