Todae

Todae

Event calendar

A recipe, not a package namespace. An event calendar shows events on a month, on a week of day columns, or on one day, in one time zone. In the week and the day, each day is a lane of its visible hours, and an event is a block on the lane its start and end fall in. There is no EventCalendar.* export.

On this page

The example is the week of 16 November 2026, open from 8:00 to 18:00. It pins America/Los_Angeles and adds Asia/Kolkata beside it. The corner lists every zone name the visible days use, such as PST or PST / PDT, in the page's language. timeZone is an IANA id. Leave it unset and the grid uses the viewer's zone. A server-rendered app passes timeZone explicitly, so the server and the browser name the same zone and the markup matches. An event is a Temporal.Instant or a Temporal.ZonedDateTime. The grid places that instant in timeZone, so the same event sits on a different hour when the zone changes. compareZone adds the second hour column. Each row is that zone's local time at the same instant as the primary hour. When the week uses two offsets, the row shows both times in the corner's order, such as 5:00 PM / 6:00 PM. The day heading names the first visible day that uses the later offset, such as PDT begins, and says Second column when that column's zone changes. A zone whose offset is not a whole hour, such as Asia/Kolkata at +5:30 or Asia/Kathmandu at +5:45, shows that minute. When the date differs, the row also shows the day shift, such as +1 day. A day shift belongs to the time it follows. Switch to Month to see that month, to Day to see one column, and use Previous and Next to move. Thursday is a busy day: overlapping events sit side by side. Offsite is all day on Monday. Retreat runs from Friday through Sunday and crosses into the next week. Launch watch runs from 10:00 PM to 2:00 AM. Book club repeats every Sunday at 3:00 to 4:00 PM, starting 15 November, and each view shows the occurrences in that window.

import {
  Button,
  Calendar,
  Dialog,
  ErrorMessage,
  Field,
  Form,
  Label,
  Menu,
  RadioGroup,
  ScrollArea,
  Switch,
  Text,
  ToggleGroup,
  VisuallyHidden,
  formatTime,
  useAnnouncer,
  useFocusHandoff,
  useLaneDrag,
  useLaneDragState,
.calendar {
  display: flex;
  flex-direction: column;
  gap: var(--todae-space-3);
  inline-size: 100%;
  min-inline-size: 0;
  container: calendar / inline-size;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--todae-space-2);
}

.range {
  margin: 0;
}

Nov 15 – Nov 21, 2026

Times in PST (GMT-8). Second column GMT+5:30, 13 h 30 min ahead.
PST
GMT+5:30

Sun, Nov 15

Mon, Nov 16

Tue, Nov 17

Wed, Nov 18

Thu, Nov 19

Fri, Nov 20

Sat, Nov 21

The time lanes

daySegments() builds one lane per visible day, open from opens to closes in timeZone. Units are elapsed minutes from that day's opening, so a day the clock changes is as long as it really is, and the night stays off the lane. toUnits() and fromUnits() turn a Temporal.ZonedDateTime into a point on that lane and back. A start at a shared midnight belongs to the later day, and an end belongs to the earlier day.

weekOf() returns the seven days that contain a day, starting on the locale's first day of the week, the same day Calendar starts on. English and Korean start on Sunday. The week view passes those seven days to daySegments(), and the day view passes the one day on screen. Every column is as tall as the longest lane, so a minute is the same height in each column. hourMarks() lists each hour from that lane's opening through the last hour that starts before the close. Each column draws those lines itself. The gutter names an hour only when every column has that same wall time at that offset. A column that differs names the hour inside the column. The corner lists every zone name the visible days use. compareZone adds the second hour column. Its row is the second zone's time at that hour. When the week shows two of those times, the row lists both, in the corner's order. Both hour columns stay out of the accessibility tree, because those hours repeat. The grid's description is a sentence that names the zone, and the second column's lead when that column is showing and the lead is the same all week. When the lead changes during the week, the sentence leaves out the time difference. When the calendar is 375px wide or narrower, the second column is left out and the first zone's name stays.

The event block

visibleSpans() keeps the part of each event that falls inside a lane and drops the rest. An event that starts before the opening is drawn from the opening, and one that runs past the close stops at the close. An event that meets two days becomes one block on each day when it meets the open hours. An all-day event is left out, and so is an event that only touches a lane at an endpoint. A timed event that covers more than one calendar day and never meets the open hours is left out too. Launch watch, from 10:00 PM to 2:00 AM, misses 8:00 to 18:00, so the lanes cannot draw it. showsInStrip() is that choice. packWeekBars() then places every all-day event, and every event the lanes leave out, on a row in the strip above the time grid. Earlier starts take an earlier row, and a longer span takes the earlier row when two start together. The strip uses the same packing in the week and in the day. spanFrame() turns a span into a top and a height as fractions of the shared length, so nothing is measured.

placeOverlaps() packs one lane's spans into columns. Spans that overlap in time, including a chain where each one overlaps the next, share that cluster's column count. Each span takes the first column that is free when it starts. When two start together, the longer one takes the column on the left. A span may widen into columns on its right that nothing else uses while it runs. The left edge and the width are fractions of the lane, so nothing is measured. Spans that only touch at an endpoint each keep the full width, one after the other. A span with no length overlaps a span only when its instant is strictly inside that span, and two spans with no length at the same instant do not overlap. The grid does not draw a span with no length, because visibleSpans() drops it. Each day column is at least 5.5rem wide, and another 4rem for every column in that day's busiest cluster, so a busy week scrolls sideways.

The block is a Menu button. Its name is the title, then the event's own start and end, written with formatTime. When the start or the end falls on another day, the name includes that day in the same form as the column heading. A block the visible hours clip says "started earlier" or "continues", and the text shows "…" on that side. A block shorter than 45 minutes shows the title only. Drag the block to move the event. Drag the top or bottom edge to change that end. The edges are not keyboard controls. The menu is. A bar in the strip is a Menu button too. Its name is the title and the full date range, in the page's language. A timed bar also reads its start and end times. … marks an end the week cuts. An all-day bar's menu moves that event to the previous or next day. Edit… changes the dates. Dragging a bar is left for later.

findConflicts() lists other occurrences that overlap an event in time. Touching at an endpoint is not an overlap. placeOverlaps() uses that same test on the lane's minutes.

The month

Month sits beside Week and Day. The switch lists Month, then Week, then Day. It shows one month in timeZone. eventsOnDay() lists the events that overlap a calendar day, from that midnight up to the next midnight. An event that ends on the next midnight stays on the earlier day. An all-day event is included here, and its dates come from its own time zone. The time lanes still leave it out. All-day events come first, then earlier starts, then titles.

Calendar draws the day buttons through Calendar.Grid, and Calendar.Header names the focused month and moves to the previous or next month. renderDay draws up to two titles in each day, in the same colors as an event block, and writes +N more as text when the day has more. The button is named by the full date, then those titles and that count, so its name holds every word the day shows. Nothing inside the day is a control. The day number sits at the start of the top of every cell, and today circles that number. Each title spans the cell, directly under that day's bars. A multi-day bar uses the accent fill and runs across the grid lines between its days. A border bounds every day, including a day outside the month, which is dimmer. Each week row is at least three day sizes tall, and it grows when a day needs more. When the month is narrower than 30rem, each bar stays as a thin segment under the day number, with no title and no end cue, and the day still shows a dot and the number of events. The titles stay in the name.

Press a day, or press Enter or Space while it is focused, and the view switches to that day. Focus moves to the day's first event. When the day has no event on the time lane, focus moves to the day heading. Arrow keys move a week. Page Up and Page Down move a month, and with Shift they move a year. The header's label and the grid's name follow the focused month. Switching to Week or Day keeps that day. The week is the one that contains it. Previous and Next keep focus on the button that was pressed.

packWeekBars() places each all-day event, and each event that covers more than one calendar day, on one row of that week. The bar is one strip across those days, split where the week ends. … appears only on the first or last day of that week, and only when the event continues past that edge. The days in between join with no cue, and each row keeps the same height so a bar stays on one line. It sits above that day's timed titles. The day still shows two of those bars and titles, and +N more counts the bars and the titles that do not fit. A day the bar covers still reads that event, with its title and its full date range.

showOutsideDays draws the days that lead and trail the month, so each week is a full row. The days that lead and trail the month stay pressable and show their events. A press opens that day.

Dragging

In the week and the day, useLaneDrag runs on axis: "block". Each day column is a lane. Every lane covers one shared range, the longest day's open minutes, which is the height of the columns. A drag snaps to a 15 minute slot. A move keeps the event's length, including any part the lane clips, and can land on another day in the week. A resize stays on the day it started and writes the edge that was dragged. Escape cancels the drag and leaves the event where it was.

A press on empty space in a lane creates an event. The press floors to the 15 minute cell under it. Dragging draws a preview of the snapped span. Dragged downward, the span starts at that cell. Dragged upward, the cell that was pressed stays inside the span, and the other end snaps to the nearest slot. The preview lines up with an event of that length. It starts at the same place in the lane, and it is the same height. It is not a control, and assistive technology does not read it. Releasing the pointer opens the editor with that day, that start, and that end. The title is ready to type. A click that stays inside the drag threshold opens the editor for one slot from that cell. Escape during the drag opens nothing and adds no event.

useLaneDrag reads that one shared range. When a clock change falls inside the visible hours, a day is shorter than the range. A place past that day's close is blocked, so the drop does not land. A resize cannot cross into the next day. The library keeps a resize on the lane where it started.

The menu on each event makes every move a drag can make. It moves the event one slot earlier or later, and, in the week, to the previous or next day. It lengthens or shortens the event by one slot, from the end. An item that would leave the day's open hours is unavailable. The day view has no previous or next day for a timed event, because that board has one lane. An all-day bar can still move to the previous or next day. After each item, focus returns to the event. A live region reads the new time, and the button's name reads it too.

Editing

Edit… opens a Dialog. The fields are the title, the date, the start, the end date, the end, and an all-day switch, using Field date and time inputs. Changing the date or the start keeps the length and moves the end with it. Save writes the event and returns focus to it, or to that day's heading when the event is off the time lanes and the strip. Cancel and Escape leave it as it was and return focus to it. The end has to be after the start. When it is not, the end field shows "End must be after the start." An all-day event keeps its end date. Save runs from the start date at midnight through the day after the end date, and those dates stay in the event's own zone. Turning an event all-day, or moving its end onto another day, puts it in the strip or on a month bar. Turning all-day off restores the times from before the switch, or starts at the opening for one slot when the event was already all day, and puts it on the time lanes, or back among that day's titles. The month still lists it.

New event, in the week and the day, opens the same dialog for a new event. It is one button. Empty slots are not tab stops. The day is the one that last had focus in the grid. When that focus was an event, the new event starts when that event ends, and it lasts one slot. When that end is too close to the day's close, the slot stops at the close. When that focus was a day heading, or nothing in the grid had focus, the new event starts at the first slot of the day on screen. A drag or a click that creates an event opens this dialog with the snapped day, start, and end. The preview stays in that day's column while the dialog is open. Save adds the event on that span. The live region says it was added, which a move does not say, and focus moves to the new event. Cancel and Escape add nothing, remove the preview, and return focus to that day's heading. Cancelling an edit returns focus to that event.

EventEditor is that dialog. It edits an event, and it fills in a new one. eventFromPlace() builds the unsaved event for the snapped place, with an empty title. The dialog calls onSave with the event the fields name.

Repeating

The calendar stores a series and draws occurrences. A series is the title, the start, the end, the time zone, and a rule. An occurrence is one instance of that series: a stable occurrence id, the series id, and the start the rule generated. The month, the week, and the day read occurrences whose start falls in the visible window. They do not read the rule, so a block is drawn the same way whether or not the event repeats. A repeating block says Repeats where it has a line for it. A timed block shows a repeat mark beside the title, so a one-hour block keeps its time. The accessible name says "repeats" too: a block's name ends with it, and a bar's name has it right after the title, where the bar shows Repeats.

Book club is one series. It starts Sunday 15 November 2026 at 3:00 PM and repeats every Sunday. The week of 16 November shows that Sunday. Next week shows the next one. A Sunday before 15 November has none.

expandSeries() returns the occurrences inside a half-open window, [start, end). The rule is a small subset of a recurrence rule, evaluated with Temporal and no extra library. It supports a daily, weekly, monthly, or yearly frequency, an interval, a count, an until instant, and, for a weekly rule, the weekdays. The week starts on Monday, as that rule does, independent of the page locale. A count counts from the series start, and a removed date still uses one of those counts. An until instant includes an occurrence that starts on it. The editor's On end is the last moment of the chosen day, so a meeting that day is included.

A monthly series that starts on the 31st skips a month that has no 31st. It does not move to the last day of that month. A yearly series that starts on 29 February skips a year that is not a leap year. An occurrence keeps its wall-clock time in the series' time zone when the clock changes, so a meeting at 9:00 stays at 9:00 after the spring-forward and after the fall-back. The length is that wall length too, so 9:00 to 10:00 stays 9:00 to 10:00. A wall time that the clock skips follows Temporal's compatible resolution.

An EXDATE removes one occurrence. An override replaces one, keyed by the start the rule generated, so a moved or edited occurrence stays that same instance. The view asks for a window that begins earlier by the series' length, so an occurrence that started before the visible days and still overlaps them is included.

New event opens this dialog with Repeat set to none. Repeat can be none, daily, weekly, monthly, or yearly. Weekly lists the days in the locale's week order, and at least one stays chosen. While one weekday is selected, that weekday follows the date, so the series starts on a day it repeats. Saving is refused when the chosen weekdays leave the start out. Ends is never, after a number of times, or on a date. Save stores a series. There is no interval field. The interval stays 1 unless a caller sets it on the series. The recurrence module sits next to the example. This page describes it and does not paste the file.

Edit… or Delete on a repeating occurrence asks which events to change: This event, This and following, or All events. The dialog is named for that choice, the explanation is its description, and the first button takes focus. Tab moves through the three buttons. Enter activates the focused one. Escape closes the dialog and returns focus to the occurrence. This event writes an override, or an EXDATE when the choice is a delete. This and following ends the series just before that occurrence and starts a new series from the form. Its count is the number still left, and later exceptions move onto that new series. A later edit moves with the new start, so an edit at 1:00 PM is at 3:00 PM when this and the following events start two hours later. All events changes the series. A one-weekday series moves onto the new start's weekday. Exceptions move by wall-clock time, so a deleted or edited occurrence keeps its local time when the start crosses a daylight-saving change. Deleting the last occurrence removes the series. After a delete, focus moves to the day heading, because the button is gone, and the live region names the date. Dragging one occurrence moves that occurrence only, and a menu move of one block does the same. Neither one asks. The live region says what changed: added, changed this event, changed this and following events, changed all events, or those same words for a delete.

Expansion walks only the window. It returns at most 400 occurrences, the earliest ones in that window. A daily series across a year stays under that cap. A longer window returns those 400 and stops.

Accessible composition

Todae handles: ToggleGroup switches Month, Week and Day and keeps one selected. Button moves to the previous or next week or day, and New event opens the editor for a new event without a pointer. Calendar draws the month, names the focused month from Calendar.Header, keeps one tab stop, names each day with the full date, then that day's titles. ScrollArea scrolls the week and the day and keeps a focused block's ring in view. Text clamps the title and the time. useLaneDrag moves, resizes, and creates a block with the pointer, snaps it to the slot grid, and cancels on Escape. Menu is the keyboard path for moving and resizing. Dialog and Field edit the exact title and time, and they name a new event. The event button takes its focus ring from Button. A live region reads the time after a change, and it says when an event was added.

You supply: A title for each event. A time zone, an optional second zone, and the visible hours. Day headings that name each column and the list of events in it. An accessible name on each event that starts with the title and includes the event's real start and end, not only the hours on screen. A bar's name starts with the title and reads the full date range. A timed bar also reads its start and end times. The 15 minute slot, and a check that the end is after the start.

Watch for: An event named only by its color. A repeating event with no visible or accessible cue that it repeats. Times written in the browser's zone when the calendar's zone is the one that matters. A second hour column that makes the page scroll sideways on a narrow screen. A week of columns with nowhere to scroll on a narrow screen. An all-day event drawn on the time grid. A multi-day event drawn as a separate chip on every day. A bar named without the days it covers. A day column fixed so narrow that side-by-side blocks are squeezed to a letter. A control inside a month day. The day button is the only interaction there. A drag with no keyboard path. A create gesture with no keyboard path, or a tab stop on every empty slot. A resize that tries to cross a day. An end that is not after the start, with nothing saying so.

When to use

When: People look at events across a month, a week, or a day in one time zone, such as a team's calendar.

When not: Items on parallel resource lanes, with conflicts across lanes → the Scheduler recipe. Picking one date or time → the Date and time picker recipe.