Skip to content

Move session schedule from hardcoded ICS to cohorts table fields #15

Description

@unforced

Context

The ICS generator (src/lib/ics.ts) currently hardcodes the live-session schedule as Mondays 5:30–7:30pm America/Denver. This works for Cohort 1 but won't survive:

  • A cohort that meets on a different day of the week
  • A cohort in a different timezone
  • A schedule change mid-cohort
  • Future cohorts we run in parallel with different cadences

Proposal

Add these columns to cohorts:

  • session_day_of_week (integer 0-6, or ISO 1-7; pick one and stick to it)
  • session_start_time (text, HH:MM local in session_timezone, e.g. "17:30")
  • session_duration_minutes (integer, default 120)
  • session_timezone (text, IANA zone — e.g. "America/Denver")

Default to the Cohort 1 values during migration so behavior is unchanged.

Then update generateCohortICS() to read from the cohort record instead of module-level constants, and drop the SESSION_* constants. VTIMEZONE blocks need to be generated per timezone — either ship a small map of common zones, or require the admin to pick from a known list at cohort creation.

Scope

  • Migration + schema update
  • Admin UI: add schedule fields to the cohort edit form (doesn't exist yet — see the inline meeting-URL form on /admin)
  • ICS generator reads from cohort instead of constants
  • Homepage / cohort-page display copy reads from the same source (today it's hardcoded in 4–5 places — see the "Mondays 5:30–7:30pm MT" string)

Out of scope

Editing the schedule mid-cohort without breaking already-downloaded .ics files. That's the subscribable-feed issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions