# calendar behaviour

*Open when wiring what a `calendar` shows, or when a create/drag gesture on one does nothing.*

Neither source plots an arbitrary entity. `calendarEvents` (the default) is hard-wired to the platform's calendar tables and shows the **signed-in viewer's own** calendars — minus any they toggled off in the platform calendar sidebar, minus `workingLocation` and cancelled rows, de-duplicated by iCalUID. Two viewers of one form see different events, and an empty grid is usually correct rather than broken. Records of your own entity belong on an `entityList` with a `calendar` view preset; this element has no entity binding at all (the old `entity`, `startField`, `filterConditions` keys are dead — written, they are ignored).

`formFields` renders exactly ONE event (id `formEvent`) built live from the bound date elements, never a list. The viewer's platform events still load beneath it as read-only background (that is what `calendarScope` narrows); dragging one silently reverts.

`allowCreate` creates nothing. On `formFields` it means "pick dates by dragging": the selected range is written straight into the bound date elements and **no event is emitted**, so a `rangeSelect` handler there is dead code. On every other source it is the reverse — the gesture only emits `rangeSelect` (`{ start, end, allDay }`); there is no create modal and no insert behind it. Unhandled, the user drags a free slot, the slot highlights, and nothing happens on a form that validates clean. You own the insert:

```js
formAPI.elements.<calendarName>.on('rangeSelect', ({ start, end }) => { /* api.entity(...) insert, or formAPI.openForm */ });
```

`allowEdit` splits the same way: on `calendarEvents` a drag/resize persists the new dates to the record and reverts on failure; on `formFields` it writes them into the bound elements.

One silent write: on `formFields`, whenever the start value changes and the end field is empty or not later than the start, the runtime overwrites the end element with start + 1 hour.
