Skip to content

localToUtc is off by an hour for wall times inside a DST transition #43

@chiptus

Description

@chiptus

Problem

localToUtc in supabase/functions/diff-schedule/helpers.ts converts a festival-local wall time to UTC using a single timezone offset. During a DST transition the offset before and after the change differs, so a set whose start/end wall time falls inside (or near) the transition is converted with the wrong offset and ends up an hour off.

Severity

Rare — it only bites a set scheduled in the 1-hour DST window, on the transition date, in a DST-observing timezone. Most festival programming doesn't land there. Filing so it isn't lost.

Suggested fix

Resolve the offset for the specific local date/time rather than a single fixed offset (e.g. derive it via Intl.DateTimeFormat with the target timeZone for that exact instant, or use a small tz library).

Context

Split out of the PR #31 review (schedule-ingestion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions