aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'internal/calendar')
-rw-r--r--internal/calendar/temporal_ef.go9
-rw-r--r--internal/calendar/temporal_ef_test.go26
2 files changed, 35 insertions, 0 deletions
diff --git a/internal/calendar/temporal_ef.go b/internal/calendar/temporal_ef.go
index a043179..6828f35 100644
--- a/internal/calendar/temporal_ef.go
+++ b/internal/calendar/temporal_ef.go
@@ -422,6 +422,15 @@ func efWeek(date time.Time, season Season, y int, easter time.Time) int {
// its ferias. Epiphany itself is a feast inside Christmas Time (RG 72),
// not the head of a numbered week.
return daysBetween(firstSundayAfterEpiphany(y), date)/7 + 1
+ case Passiontide:
+ // Passiontide is TWO weeks and they are not interchangeable: Passion
+ // week (from Passion Sunday, Easter-14) and Holy Week (from Palm
+ // Sunday, Easter-7) have entirely different Masses. Numbering them
+ // both 0 -- which is what falling through to the default did -- gave
+ // every day of Holy Week the slug of its Passion-week namesake, so the
+ // two weeks shared one set of readings and Holy Week could not have
+ // its own.
+ return daysBetween(easter.AddDate(0, 0, -14), date)/7 + 1
case Septuagesima:
return daysBetween(easter.AddDate(0, 0, -63), date)/7 + 1
case Easter_:
diff --git a/internal/calendar/temporal_ef_test.go b/internal/calendar/temporal_ef_test.go
index e8ef391..d930cc7 100644
--- a/internal/calendar/temporal_ef_test.go
+++ b/internal/calendar/temporal_ef_test.go
@@ -334,3 +334,29 @@ func TestTemporalEFRogationDays(t *testing.T) {
"commemoration cannot be built here without displacing the Vigil", got.Cel.Slug)
}
}
+
+// TestTemporalEFPassiontideWeeks pins that Passion week and Holy Week are
+// numbered apart. They are two weeks with entirely different Masses, and
+// efWeek used to give both 0 -- so every day of Holy Week took the slug of its
+// Passion-week namesake and the two shared one set of readings.
+//
+// Good Friday is the case that shows why it matters: it was reading Passion
+// Friday's Mass.
+func TestTemporalEFPassiontideWeeks(t *testing.T) {
+ easter := d("2026-04-05")
+ for _, c := range []struct {
+ off int
+ slug string
+ }{
+ {-13, "ef-passiontide-1-monday"}, // Passion week
+ {-11, "ef-passiontide-1-wednesday"},
+ {-6, "ef-passiontide-2-monday"}, // Holy Week
+ {-2, "ef-passiontide-2-friday"}, // Good Friday
+ } {
+ day := easter.AddDate(0, 0, c.off)
+ if got := temporalEF(day).Cel.Slug; got != c.slug {
+ t.Errorf("Easter%+d (%s): slug = %q, want %q -- Passion week and Holy Week "+
+ "must not share a slug", c.off, day.Format("2006-01-02"), got, c.slug)
+ }
+ }
+}