Agenda · Displaying events
Recurring events
A month of team rituals from a handful of recurring events, with the selected day listed below.
Live demo
Pick a Thursday · Pick next Wednesday
Fullscreenimport { ProScheduler } from "@andreisaac/pro-scheduler"
import { teamRituals, teamRooms } from "./data/rituals"
import { useEvents } from "./kit"
export function AgendaRecurringDemo() {
const { events, handlers } = useEvents(() => teamRituals())
return (
<ProScheduler
data={events}
resources={teamRooms}
view={{ calendar: { type: "month", labels: 2 }, agenda: { type: "day" } }}
height={720}
{...handlers}
/>
)
}// data/rituals.ts — sample data, relative to the current week or month.
import type { SchedulerEvent, SchedulerResource } from "@andreisaac/pro-scheduler"
import { weekStart } from "./studio"
export const teamRooms: SchedulerResource[] = [
{ id: "team", name: "Whole team", color: "#2563eb" },
{ id: "eng", name: "Engineering", color: "#059669" },
{ id: "design", name: "Design", color: "#d97706" },
{ id: "leads", name: "Leads", color: "#7c3aed" },
]
const at = (base: Date, day: number, hour: number, minute = 0) =>
new Date(base.getFullYear(), base.getMonth(), base.getDate() + day, hour, minute)
/** "YYYY-MM-DD" of a local day. */
const iso = (d: Date) =>
`${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`
export function teamRituals(base = weekStart()): SchedulerEvent[] {
return [
{
id: "standup",
title: "Standup",
start: at(base, 0, 9, 30),
end: at(base, 0, 9, 45),
resource: "eng",
// every weekday; skipped next Wednesday (offsite)
recurring: { repeat: "weekly", weekDays: "MO,TU,WE,TH,FR" },
recurringException: [iso(at(base, 9, 0))],
},
{
id: "design-crit",
title: "Design crit",
start: at(base, 1, 14),
end: at(base, 1, 15),
resource: "design",
recurring: "FREQ=WEEKLY;BYDAY=TU,TH",
},
{
id: "planning",
title: "Sprint planning",
start: at(base, 0, 10),
end: at(base, 0, 11, 30),
resource: "team",
recurring: { repeat: "weekly", interval: 2 },
},
{
id: "retro",
title: "Retro",
start: at(base, 11, 16),
end: at(base, 11, 17),
resource: "team",
recurring: { repeat: "weekly", interval: 2, weekDays: "FR" },
},
{
id: "one-to-ones",
title: "Leads 1:1s",
start: at(base, 2, 11),
end: at(base, 2, 12),
resource: "leads",
recurring: { repeat: "weekly", count: 12 },
},
{
id: "all-hands",
title: "All-hands",
start: at(base, 3, 17),
end: at(base, 3, 18),
resource: "team",
// the first Thursday of every month
recurring: { repeat: "monthly", weekDays: "1TH" },
},
{ id: "launch", title: "Launch review", start: at(base, 3, 13), end: at(base, 3, 14, 30), resource: "leads" },
{ id: "offsite", title: "Team offsite", start: at(base, 9, 0), end: at(base, 10, 0), allDay: true, resource: "team" },
]
}About this demo
A month of team rituals from a handful of recurring events, with the selected day listed below.
Things to try
- Pick a Thursday
- Pick next Wednesday
The props behind it are explained in Recurrence, time zones and order.