diff options
Diffstat (limited to 'internal/readings/offline.go')
| -rw-r--r-- | internal/readings/offline.go | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/internal/readings/offline.go b/internal/readings/offline.go index be7c430..b2c16df 100644 --- a/internal/readings/offline.go +++ b/internal/readings/offline.go @@ -162,10 +162,56 @@ func dayInfo(cfg config.Config, day calendar.LiturgicalDay) liturgy.DayInfo { return liturgy.DayInfo{ Name: celebrationName(cfg, day.Observed), Colour: string(day.Colour), - Rank: string(day.Observed.Rank), + Rank: displayRank(cfg, day), } } +// displayRank is the Ordinary Form's REPORTED rank for the observed +// celebration -- it never changes calendar.Celebration.Rank (the engine's own +// field, which drives precedence via ofRankOrder); it only relabels what is +// handed to a caller here, after the engine has already finished computing. +// +// In the 1969 Universal Norms' Table of Liturgical Days, Sunday is its own +// category, not a solemnity. The calendar engine's temporal.go builds every +// "Nth Sunday of <season>" day (Ordinary Time, Advent, Lent, the Easter +// season, Christmas time, and Palm Sunday) with sundayDay(), which sets +// Rank=solemnity but leaves Class at its zero value (calendar.ClassNone) -- +// solemnity is a placeholder there, not a real classification. A genuinely +// NAMED solemnity of the Lord that happens to fall on a Sunday (Easter Sunday +// itself, Pentecost, Ascension/Corpus Christi when transferred, Trinity, +// Christ the King, Christmas, Epiphany) is built by solemn(), which does set +// Class=ClassLord, and must keep reporting "solemnity"; a feast of the Lord +// (Holy Family, Baptism of the Lord) is Rank=feast already and is untouched. +// +// Investigated first: temporal.go's own Sunday bool (sundayDay's +// `Sunday: !priv`) looked like the natural signal, but it does not reach +// calendar.LiturgicalDay at all (LiturgicalDay carries no such field, only +// the aggregate ObservedBand), and even if plumbed through it would be the +// wrong signal here -- by its own doc comment it marks only the band-6 +// Christmas-time/Ordinary-time Sundays, not the band-2 Advent/Lent/Easter +// Sundays this change must ALSO relabel (the 1st Sunday of Advent from the +// original bug report is band 2, Privileged=true, Sunday=false). Using +// Celebration.Class instead of that flag, or of temporalDay.Privileged, +// covers exactly the sundayDay()-built set in both bands without adding any +// new field: RankSolemnity + Layer=="temporal" + Class!=ClassLord occurs only +// from sundayDay(), and (checked against every call site in temporal.go) only +// ever on an actual Sunday, so the weekday check below is defensive, not +// load-bearing. +// +// The Extraordinary Form (1962) has no such category and is untouched: this +// only ever fires when the modern form is selected. +func displayRank(cfg config.Config, day calendar.LiturgicalDay) string { + obs := day.Observed + if cfg.Selection().Form != "old" && + day.Weekday == time.Sunday && + obs.Layer == "temporal" && + obs.Rank == calendar.RankSolemnity && + obs.Class != calendar.ClassLord { + return string(calendar.RankSunday) + } + return string(obs.Rank) +} + // celebrationName is the observed celebration's name in the UI language, // resolved by naming.CelebrationName (name.<lang> -> English -> Latin -> // humanized slug). An empty result (unnamed feria) omits the header line. |
