diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 14:46:17 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 14:46:17 +0200 |
| commit | cf45e9f7f3146bca6039b63e2be02463b02f8043 (patch) | |
| tree | 78ce3ee214114302b39359993da865e5e334eb41 /internal | |
| parent | a80e61963756a28a3963a0442a8ccc1572518373 (diff) | |
| download | lectio-cf45e9f7f3146bca6039b63e2be02463b02f8043.tar.gz lectio-cf45e9f7f3146bca6039b63e2be02463b02f8043.zip | |
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).
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/caldata/readings.go | 7 | ||||
| -rw-r--r-- | internal/caldata/tridentine-lectionary.ini | 20 | ||||
| -rw-r--r-- | internal/calendar/calendar.go | 13 |
3 files changed, 37 insertions, 3 deletions
diff --git a/internal/caldata/readings.go b/internal/caldata/readings.go index 1b87b7a..3e46ccd 100644 --- a/internal/caldata/readings.go +++ b/internal/caldata/readings.go @@ -76,11 +76,12 @@ func Readings(sel calendar.Selection, layers []calendar.Layer, date time.Time, d return r } } - // EF: a green-season weekday with no proper Mass repeats the preceding Sunday. + // EF: a green-season weekday with no proper Mass repeats the preceding + // Sunday's Mass. Use the Sunday's TEMPORAL slug (not its observed) so the + // repeat still resolves when that Sunday was a feast (e.g. the Purification). if sel.Form == "old" && day.Observed.Layer == "temporal" && date.Weekday() != time.Sunday { sun := date.AddDate(0, 0, -int(date.Weekday())) // preceding Sunday (Sunday = 0) - sd := calendar.Compute(sun, sel, layers) - return TemporalReadings(sel.Form, sd.Observed.Slug) + return TemporalReadings(sel.Form, calendar.TemporalSlug(sun, sel)) } return nil } diff --git a/internal/caldata/tridentine-lectionary.ini b/internal/caldata/tridentine-lectionary.ini index cef3f2d..52ac060 100644 --- a/internal/caldata/tridentine-lectionary.ini +++ b/internal/caldata/tridentine-lectionary.ini @@ -472,3 +472,23 @@ gospel = Luke 19:41-47 [ef-trinity] first = Rom 11:33-36. gospel = Matt 28:18-20 + +[ef-nativity] +first = Heb 1:1-12 +gospel = John 1:1-14 + +[ef-epiphany] +first = Isa 60:1-6 +gospel = Matt 2:1-12 + +[ef-circumcision] +first = Titus 2:11-15 +gospel = Luke 2:21 + +[ef-time-after-epiphany-sunday-6] +first = 1 Thess 1:2-10 +gospel = Matt 13:31-35 + +[ef-time-after-pentecost-sunday-28] +first = Col 1:9-14 +gospel = Matt 24:15-35 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) |
