From 6641ce335de522e6d51c47ad9d14f69726650592 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 09:30:22 +0200 Subject: fix(of): canonical OT ferial week numbering + CR-sourced ferial lectionary The Ordinary Form ferial lectionary had two linked defects, both from harvesting niedziela.pl by date: (1) post-Pentecost Ordinary-Time ferial WEEK NUMBERS were one too high (temporal.go counted back from Christ the King using the weekday itself, not its preceding Sunday, so a ferial took the next week's number), and (2) ~17 ferial keys held a SAINT's readings (stored when a saint displaced the ferial on the queried date, e.g. week 22 smeared with a Marian Prov 8/John 2), plus 16 weekday slots were missing entirely. - temporal.go: number a span-2 ferial from its preceding Sunday. Verified 388/388 ferial-week agreement with calapi across 2026-2028. - scripts/genlect-of-cr.py: regenerate the Ordinary-Time ferial lectionary (first/psalm/gospel, both years, all 34 weeks) from catholic-resources.org (Fr. Felix Just, S.J.), which is keyed by liturgical position (immune to by-date contamination) and complete. Citations only; text still rendered from the public-domain corpora. of-lectionary.ini OT ferials now 408 (was 392). Fixes ~17 contaminated entries + 16 gaps + the week-numbering audit item. Psalms already share modern numbering, so no conversion. Adds TestOFOrdinaryTimeFerialWeek. Credits catholic-resources.org in NOTICE. Bumps to 0.40.0. --- internal/calendar/temporal.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'internal/calendar/temporal.go') diff --git a/internal/calendar/temporal.go b/internal/calendar/temporal.go index 13f1385..ab1a742 100644 --- a/internal/calendar/temporal.go +++ b/internal/calendar/temporal.go @@ -231,8 +231,13 @@ func temporal(date time.Time, sel Selection) temporalDay { if date.Before(ashWed) { week = daysBetween(baptismThis, date)/7 + 1 } else { - // count back from Christ the King = the 34th week. - week = 34 - daysBetween(date, christTheKing)/7 + // Span 2 resumes after Pentecost; Sundays are numbered backward from + // Christ the King (the 34th and last Sunday). A weekday takes the number + // of its preceding Sunday, so count from that Sunday, not from the + // weekday itself (which would round toward Christ the King and land a + // week too high — the OT ferial off-by-one). + precedingSunday := date.AddDate(0, 0, -int(date.Weekday())) + week = 34 - daysBetween(precedingSunday, christTheKing)/7 } if week < 1 { week = 1 -- cgit v1.3