diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-31 14:07:46 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-31 14:08:29 +0200 |
| commit | 58deef45d6039d78bc423554f630d27f6bec1bb3 (patch) | |
| tree | 2b4b426a06d4874d0e136f4232b25757301a0345 /lib/kernel/computus.ml | |
| parent | 9c0a755767da935dce6bfdaed2f7e11cfd30421a (diff) | |
| download | colitur-58deef45d6039d78bc423554f630d27f6bec1bb3.tar.gz colitur-58deef45d6039d78bc423554f630d27f6bec1bb3.zip | |
kernel(computus): Easter-relative movable-feast anchors
Ash Wednesday/Palm Sunday/Ascension/Pentecost/Corpus Christi as Easter+/-N.
Verified vs 2026 dates; exhaustive weekday invariants 1583..9999 (Ash Wed=Wed,
Ascension/Corpus Christi=Thu, Palm/Pentecost=Sun).
Diffstat (limited to 'lib/kernel/computus.ml')
| -rw-r--r-- | lib/kernel/computus.ml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/kernel/computus.ml b/lib/kernel/computus.ml index 1f60fb7..ba803d2 100644 --- a/lib/kernel/computus.ml +++ b/lib/kernel/computus.ml @@ -18,6 +18,13 @@ let gregorian_easter y = let day = ((h + l - (7 * m) + 114) mod 31) + 1 in mk y month day +let anchor y offset = Date.add_days (gregorian_easter y) offset +let ash_wednesday y = anchor y (-46) +let palm_sunday y = anchor y (-7) +let ascension y = anchor y 39 +let pentecost y = anchor y 49 +let corpus_christi y = anchor y 60 + (* Meeus Julian Easter: gives the JULIAN-calendar month/day; convert to the same physical day expressed in the proleptic Gregorian calendar by adding the Julian->Gregorian offset (days = y/100 - y/400 - 2). *) |
