From ea719cf19a4e2790b403dce8c213437e12085316 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Sat, 5 Sep 2026 20:51:06 -0400 Subject: [PATCH] Fix Septuagesima-tide Sundays all showing the same label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit temporalLabel's season-fallback branch used day.season, which lumps Septuagesima/Sexagesima/Quinquagesima into one coarse 'septuagesima' bucket — so all three Sundays rendered as "Septuagesima Sunday". Now distinguishes them via resolveTemporalId, the same governing-Sunday id the content layer already keys collects/propers off of. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01LGsATZvfnpQ81HQuoF5JuL --- src/calendar/day-label.ts | 40 ++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/calendar/day-label.ts b/src/calendar/day-label.ts index 6ae1009..70a4ee9 100644 --- a/src/calendar/day-label.ts +++ b/src/calendar/day-label.ts @@ -271,6 +271,15 @@ function anchorDayName(day: LiturgicalDay, withRank = true): Bi | undefined { * Trinity" calculation would produce. */ const FIXED_LAST_SUNDAY_ORDINAL = 23; +/** The three named Sundays/weeks of Septuagesima-tide, keyed by + * `resolveTemporalId`'s own governing-Sunday id — see `temporalLabel`'s + * `!config` fallback for why this is needed at all. */ +const SEPTUAGESIMATIDE_NAMES: Record = { + septuagesima: bi('Septuagesima', 'Septuagesima'), + sexagesima: bi('Sexagesima', 'Sexagesima'), + quinquagesima: bi('Quinquagesima', 'Quinquagesima'), +}; + /** * Trinitytide's ordinal display can't be pure "weeks since Trinity's own * first Sunday" arithmetic once the season gets late enough — see @@ -341,13 +350,30 @@ export function temporalLabel(day: LiturgicalDay): Bi { const weekdayName = weekdayLabel(day); const config = ORDINAL_SEASONS[day.season]; if (!config) { - // No ordinal convention modeled for this season (Septuagesima-tide, - // Passiontide, Ascensiontide, Pentecost, Christmastide, the - // Corpus-Christi/Sacred-Heart single-day seasons) — their few days - // mostly have their own proper names rather than ordinal counting, so - // this fallback is expected to be seen, not a gap to fill later. No - // authored Latin season name exists for these yet, so `la` falls back - // to the same English season word. + // Septuagesima-tide's own three named Sundays/weeks (Septuagesima, + // Sexagesima, Quinquagesima) all share the single coarse `septuagesima` + // `Season` bucket (easter-offsets.yml's ranges only change at Lent), so + // `day.season` alone can't tell them apart — falling through to the + // generic seasonName branch below named every one of them + // "Septuagesima" regardless of which week it actually was. Distinguish + // them via `resolveTemporalId`, the same governing-Sunday-offset id the + // content layer already keys off, so this can never disagree with what + // collect/propers are actually in effect that week. + if (day.season === 'septuagesima') { + const name = SEPTUAGESIMATIDE_NAMES[resolveTemporalId(day.date)]; + if (name) { + return day.weekday === 'sunday' + ? bi(`${name.en} Sunday`, `Dominica in ${name.la}`) + : bi(`${weekdayName.en} in ${name.en} week`, `${weekdayName.la} in ${name.la}`); + } + } + // No ordinal convention modeled for this season (Passiontide, + // Ascensiontide, Pentecost, Christmastide, the Corpus-Christi/Sacred- + // Heart single-day seasons) — their few days mostly have their own + // proper names rather than ordinal counting, so this fallback is + // expected to be seen, not a gap to fill later. No authored Latin + // season name exists for these yet, so `la` falls back to the same + // English season word. const seasonName = capitalize(day.season.replace(/-/g, ' ')); return bi(`${weekdayName.en} in ${seasonName}`, `${weekdayName.la} in ${seasonName}`); }