https://github.com/42proger/easter-date.js
:calendar: :church: Easter Dates Calculator on JavaScript. Based on Gauss's Easter algorithm
https://github.com/42proger/easter-date.js
algorithm algorithms easter easter-date eastern typescript
Last synced: 11 days ago
JSON representation
:calendar: :church: Easter Dates Calculator on JavaScript. Based on Gauss's Easter algorithm
- Host: GitHub
- URL: https://github.com/42proger/easter-date.js
- Owner: 42proger
- License: mit
- Created: 2022-09-19T12:20:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-10T07:27:01.000Z (3 months ago)
- Last Synced: 2026-03-10T13:19:22.248Z (3 months ago)
- Topics: algorithm, algorithms, easter, easter-date, eastern, typescript
- Language: TypeScript
- Homepage:
- Size: 451 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Easter Date Calculation
[](https://www.npmjs.com/package/easter-date.js)
[](https://github.com/42proger/easter-date.js/actions/workflows/github-code-scanning/codeql)
[](https://packagephobia.com/result?p=easter-date.js)
This project provides two algorithms for calculating the date of Easter in the Western (Catholic and Protestant) and Orthodox calendars.
Based on Gauss's Easter algorithm:
https://doi.org/10.1007/s00407-004-0078-5
## Installing
Install with npm
```bash
npm install easter-date.js
```
or yarn:
```bash
yarn add easter-date.js
```
## Usage/Examples
To use the algorithms, import them into your JavaScript code:
```javascript
// ES Modules
import { getWesternEaster, getOrthodoxEaster } from "easter-date.js";
```
```javascript
// CommonJS
const { getWesternEaster, getOrthodoxEaster } = require('easter-date.js');
```
and pass the desired year as an argument:
```javascript
getWesternEaster(2024);
// Output: { day: 31, month: 3, year: 2024 }
getOrthodoxEaster(2024);
// Output: { day: 5, month: 5, year: 2024 }
```
## Run Locally
Clone the project
```bash
git clone https://github.com/42proger/easter-date.js
```
Go to the project directory
```bash
cd easter-date.js
```
Install dependencies
```bash
npm install
```
Run a compile
```bash
npm run build
```
## Running Tests
To run the tests, install the required dependencies and run the following command:
```bash
npm run test
```
## License
[MIT](https://opensource.org/licenses/MIT)