From cf45e9f7f3146bca6039b63e2be02463b02f8043 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 14:46:17 +0200 Subject: fix(EF): fill reading gaps (major feasts, feria-repeat-through-feast, sundays) EF readings had ~1.8% of days with no readings (major feasts falling back to the wrong Sunday, feria-repeats broken when the preceding Sunday was a feast). Now 0 gaps over 9496 days (2025-2050); reading correctness spot-checks match missalemeum except the resumed-Epiphany-Sunday edge (next commit). - calendar.TemporalSlug: the green-season weekday-repeats-the-Sunday rule uses the Sunday's TEMPORAL slug, so a Monday still finds its Sunday Mass when that Sunday was displaced by a feast (e.g. the Purification on Feb 2). - Add the missing EF temporal Masses (from missalemeum): the Nativity Day Mass (Heb 1:1-12 / John 1:1-14), Epiphany (Isa 60:1-6 / Matt 2:1-12), the Octave Day of Christmas (Titus 2:11-15 / Luke 2:21), the 6th Sunday after Epiphany (1 Thess 1:2-10 / Matt 13:31-35), and the last Sunday after Pentecost (Col 1:9-14 / Matt 24:15-35). --- internal/calendar/calendar.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/calendar') diff --git a/internal/calendar/calendar.go b/internal/calendar/calendar.go index 9f24caf..33706d8 100644 --- a/internal/calendar/calendar.go +++ b/internal/calendar/calendar.go @@ -18,6 +18,19 @@ func Compute(date time.Time, sel Selection, layers []Layer) LiturgicalDay { return computeOF(date, sel, layers) } +// TemporalSlug returns the slug of date's TEMPORAL day (the season's Sunday or +// feria), ignoring any sanctoral celebration that outranks it. The EF's +// green-season weekday-repeats-the-Sunday rule uses this so a Monday still finds +// its Sunday Mass even when that Sunday was displaced by a feast (e.g. the +// Purification on Feb 2). +func TemporalSlug(date time.Time, sel Selection) string { + date = date.UTC().Truncate(24 * time.Hour) + if sel.Form == "old" { + return temporalEF(date).Cel.Slug + } + return temporal(date, sel).Cel.Slug +} + // computeEF computes the Extraordinary Form (1962) day. func computeEF(date time.Time, sel Selection, layers []Layer) LiturgicalDay { td := temporalEF(date) -- cgit v1.3