aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar/temporal_ef.go
diff options
context:
space:
mode:
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
}