easter-date-spencer-pmb

1.0.2 • Public • Published

easter-date-spencer-pmb

Calculate the date of roman-catholic easter sunday, using the Spencer algorithm.

I had a translation program adapt the algorithm from the description on its German wikipedia page, then tweaked the result for performance.

The page's footnotes list the original English language sources, and also depicts one of them. Unfortunately at time of writing this module, the English wikipedia seemed to not have an article about the algorithm.

Usage

This module exports one function:

var spencer = require('easter-date-spencer-pmb');
console.log(spencer(2018));   // { month: 4, day: 1 }

Why use the Spencer algorithm?

As far as I understand the various Easter date calculcation methods, the advantage of the Spencer algorithm is that it takes moon orbit into account, thus producing the correct result for all years of the Gregorian calendar starting from 325 AD.

Beware: Other algorithms seem to be valid for "most of the years", requiring a table lookup in a list of exceptions to see whether the formula applies.

Date ranges

Don't be fooled by the 31 (number of days in March) in the formulae for n and p. The English wikipedia's List of dates for Easter gives the possible date range as:

  • earliest: March 22 (e.g. in 1818)
  • latest: April 25 (e.g. in 1943)

The first 21 days of March are out of range, so there are 10 possible days in March. April adds 25 candidates, so in total there are 35 possibilities.

 

License

ISC

Dependents (0)

Package Sidebar

Install

npm i easter-date-spencer-pmb

Weekly Downloads

5

Version

1.0.2

License

ISC

Unpacked Size

6.77 kB

Total Files

11

Last publish

Collaborators

  • mk-pmb