Add recurring series to events
A Series checkbox under When opens a panel for the schedule: weekly on chosen weekdays, monthly by date, or monthly by weekday position, every N weeks or months, with meeting times and an optional meeting count. starts_on anchors the schedule and ends_on bounds it, so effective_status needs no change. Occurrences are derived, not stored. src/lib/eventSeries.ts builds the schedule label shown on cards and the event page, and the upcoming dates listed on the event page. Migration 016 adds the columns; the CRUD engine gains a time type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
aebc1c302b
commit
5ed7994a64
11 changed files with 500 additions and 3 deletions
|
|
@ -326,6 +326,62 @@ const organizations = {
|
|||
|
||||
/* ── Events ──────────────────────────────────────────────────── */
|
||||
|
||||
/* The panel the Series checkbox opens. Starts and Ends above stay
|
||||
the series' bounds — the first meeting and the last day it can
|
||||
meet — so nothing here repeats them. */
|
||||
const SERIES_WEEKDAYS = [
|
||||
["sun", "Sunday"],
|
||||
["mon", "Monday"],
|
||||
["tue", "Tuesday"],
|
||||
["wed", "Wednesday"],
|
||||
["thu", "Thursday"],
|
||||
["fri", "Friday"],
|
||||
["sat", "Saturday"],
|
||||
];
|
||||
|
||||
const seriesGroup = {
|
||||
legend: "Series",
|
||||
when: { path: "is_series", value: 1 },
|
||||
note:
|
||||
"Starts is the first meeting and anchors the schedule; Ends, if set, is the last " +
|
||||
"day it can meet. The weekdays only apply to a weekly series; with none ticked it " +
|
||||
"meets on the start date's day. Leave Date label blank and the site describes " +
|
||||
"the schedule itself.",
|
||||
fields: [
|
||||
{
|
||||
path: "series_frequency",
|
||||
label: "Repeats",
|
||||
widget: "select",
|
||||
options: [
|
||||
["weekly", "Weekly, on the days ticked below"],
|
||||
["monthly_date", "Monthly, on the start date's day (the 13th)"],
|
||||
["monthly_weekday", "Monthly, on the start date's weekday (2nd Tuesday)"],
|
||||
],
|
||||
blankLabel: "— weekly —",
|
||||
},
|
||||
{
|
||||
path: "series_interval",
|
||||
label: "Every",
|
||||
widget: "number",
|
||||
help: "1 for every week or month, 2 for every other, and so on",
|
||||
},
|
||||
{ path: "series_start_time", label: "Start time", widget: "time" },
|
||||
{ path: "series_end_time", label: "End time", widget: "time" },
|
||||
{
|
||||
path: "series_count",
|
||||
label: "Number of meetings",
|
||||
widget: "number",
|
||||
help: "Stops after this many. Blank to run until Ends, or indefinitely",
|
||||
},
|
||||
...SERIES_WEEKDAYS.map(([day, name]) => ({
|
||||
path: `series_${day}`,
|
||||
label: name,
|
||||
widget: "checkbox",
|
||||
help: `Meets on ${name}s`,
|
||||
})),
|
||||
],
|
||||
};
|
||||
|
||||
const events = {
|
||||
key: "events",
|
||||
label: "Events",
|
||||
|
|
@ -400,8 +456,15 @@ const events = {
|
|||
options: ["upcoming", "past", "cancelled"],
|
||||
blankLabel: "— derive from end date —",
|
||||
},
|
||||
{
|
||||
path: "is_series",
|
||||
label: "Series",
|
||||
widget: "checkbox",
|
||||
help: "Repeats on a schedule — a weekly class, a monthly meeting",
|
||||
},
|
||||
],
|
||||
},
|
||||
seriesGroup,
|
||||
{ legend: "Where", fields: PLACE_FIELDS },
|
||||
{
|
||||
legend: "Appearance",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue