aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar/temporal_ef.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 15:22:14 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 15:22:14 +0200
commit88ade3a7b7e15e6742d367bdc4b95b1293b92429 (patch)
tree91f721176e3f28dc9c06566101cb441538e145fc /internal/calendar/temporal_ef.go
parent28699aa44df1d791fb48618a8f06627f230432d4 (diff)
downloadlectio-88ade3a7b7e15e6742d367bdc4b95b1293b92429.tar.gz
lectio-88ade3a7b7e15e6742d367bdc4b95b1293b92429.zip
feat: EF temporal Sunday lectionary (offline Sunday Mass readings)
Unique temporal-day slugs (season-sunday-week); scripts/genlect.go generates tridentine-lectionary.ini from missalemeum keyed by slug (55 entries: the Sundays of the whole EF year). caldata.TemporalReadings(form,slug) lookup; --liturgy resolves proper-of-feast else the temporal cycle and renders the text. bible.ParseRef strips abbreviation dots (1 Cor. -> 1 Cor). 52/53 Sundays fully resolve offline.
Diffstat (limited to 'internal/calendar/temporal_ef.go')
-rw-r--r--internal/calendar/temporal_ef.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/calendar/temporal_ef.go b/internal/calendar/temporal_ef.go
index 725aac2..151bd1b 100644
--- a/internal/calendar/temporal_ef.go
+++ b/internal/calendar/temporal_ef.go
@@ -1,6 +1,9 @@
package calendar
-import "time"
+import (
+ "strconv"
+ "time"
+)
// Extraordinary Form (1962) season constants. Advent/Christmas/Lent/Easter are
// shared with the OF; these are EF-specific.
@@ -114,11 +117,12 @@ func temporalEF(date time.Time) temporalDay {
// Sundays vs ferias of the current season.
if sun {
+ week := efWeek(date, season, y, easter)
rank := RankClass2
if season == Advent && sameDay(date, adventStart(y)) {
rank = RankClass1 // 1st Sunday of Advent
}
- return efCel(season, "ef-"+string(season)+"-sunday", col, rank, efWeek(date, season, y, easter))
+ return efCel(season, "ef-"+string(season)+"-sunday-"+strconv.Itoa(week), col, rank, week)
}
rank := RankClass4 // per-annum feria
if season == Advent || season == Lent || season == Passiontide || season == Septuagesima {
@@ -140,6 +144,10 @@ func efWeek(date time.Time, season Season, y int, easter time.Time) int {
case TimeAfterEpiphany:
jan6 := time.Date(y, 1, 6, 0, 0, 0, 0, time.UTC)
return daysBetween(jan6, date)/7 + 1
+ case Septuagesima:
+ return daysBetween(easter.AddDate(0, 0, -63), date)/7 + 1
+ case Easter_:
+ return daysBetween(easter, date)/7 + 1
default:
return 0
}