diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-18 17:15:27 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-18 17:15:27 +0200 |
| commit | d27336dc65c7348dcda639b7e43e8948e7bb1caa (patch) | |
| tree | ac3d06858a5152c0908eb2d5344439f00a05ca3d /internal/caldata | |
| parent | c4bface0c72283cef55f548feb2a4a3d9eff1e6c (diff) | |
| download | lectio-d27336dc65c7348dcda639b7e43e8948e7bb1caa.tar.gz lectio-d27336dc65c7348dcda639b7e43e8948e7bb1caa.zip | |
fix(ef): the ferias between Epiphany and the Sunday after it
They repeat Epiphany's own Mass, Isa 60:1-6 / Matt 2:1-12. lectio gave them
the Mass of the first Sunday AFTER Epiphany (Rom 12:1-5 / Luke 2:42-52), which
belongs to the ferias that follow that Sunday, not to the ones before it.
The two groups cannot be told apart by slug: both are
ef-time-after-epiphany-1-<weekday>, because the week numbering starts at the
Sunday and the days before it fall in the same numbered week. So the split is
made on the date, against the same anchor efWeek uses.
Saturdays need no exclusion here -- an unoccupied Saturday in the window
carries Our Lady's office and her Mass, and that check runs first. colitur
reaches the same result by listing only the five non-Saturday weekdays.
7, 9 and 12 January 2026 now all match colitur, the 12th being the boundary
case: it follows the Sunday of the 11th and correctly keeps Rom 12:1-5.
Diffstat (limited to 'internal/caldata')
| -rw-r--r-- | internal/caldata/readings.go | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/internal/caldata/readings.go b/internal/caldata/readings.go index d082e26..2b3b5af 100644 --- a/internal/caldata/readings.go +++ b/internal/caldata/readings.go @@ -66,6 +66,9 @@ func Readings(sel calendar.Selection, layers []calendar.Layer, date time.Time, d if r := efEpiphanytideOpeningReadings(day); len(r) > 0 { return r } + if r := efEpiphanyWeekReadings(day); len(r) > 0 { + return r + } if r := TemporalReadings("old", day.Observed.Slug); len(r) > 0 { return r } @@ -222,3 +225,49 @@ func efEpiphanytideOpeningReadings(day calendar.LiturgicalDay) []calendar.Readin {Part: "gospel", Citation: "Luke 2:21"}, } } + +// efEpiphanyWeekReadings returns the Mass of a FERIAL day between Epiphany and +// the first Sunday after it. +// +// Those days repeat the Epiphany's own Mass, Isa 60:1-6 / Matt 2:1-12. The +// ferias AFTER that Sunday take the Sunday's Mass instead (Rom 12:1-5 / +// Luke 2:42-52), which is what the walk-back already gives them correctly. +// +// lectio cannot tell the two groups apart by slug: both are +// ef-time-after-epiphany-1-<weekday>, because the week numbering starts at the +// Sunday and the days before it fall in the same numbered week. So the split +// is made here, on the date, against the same anchor efWeek uses. +// +// Saturdays are excluded by the BVM check running before this one -- an +// unoccupied Saturday in the window carries Our Lady's office and her Mass. +// colitur reaches the same result by listing only the five non-Saturday +// weekdays in its own table. +func efEpiphanyWeekReadings(day calendar.LiturgicalDay) []calendar.Reading { + if day.Date.Month() != time.January || day.Date.Day() < 7 { + return nil + } + if !day.Date.Before(firstSundayAfterEpiphanyForReadings(day.Date.Year())) { + return nil + } + if !strings.HasPrefix(day.Observed.Slug, "ef-") || day.Weekday == time.Sunday { + return nil + } + if !strings.Contains(day.Observed.Slug, "-epiphany-") && !strings.Contains(day.Observed.Slug, "-christmas-") { + return nil + } + return []calendar.Reading{ + {Part: "first", Citation: "Isa 60:1-6"}, + {Part: "gospel", Citation: "Matt 2:1-12"}, + } +} + +// firstSundayAfterEpiphanyForReadings mirrors calendar's own anchor. Duplicated +// rather than exported because the two packages are separate and one date +// helper is a smaller cost than widening an API for it. +func firstSundayAfterEpiphanyForReadings(y int) time.Time { + d := time.Date(y, time.January, 7, 0, 0, 0, 0, time.UTC) + for d.Weekday() != time.Sunday { + d = d.AddDate(0, 0, 1) + } + return d +} |
