Coder Social home page Coder Social logo

42proger / easter-date.js Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 180 KB

:calendar: :church: Easter Dates Calculator on JavaScript. Based on Gauss's Easter algorithm

License: MIT License

JavaScript 15.90% TypeScript 84.10%
algorithms easter algorithm easter-date eastern typescript

easter-date.js's Introduction

Easter Date Calculation

NPM Type Definitions CodeQL npm bund#le size

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

  npm install easter-date.js

or yarn:

  yarn add easter-date.js

Usage/Examples

To use the algorithms, import them into your JavaScript code:

// ES Modules
import { getWesternEaster, getOrthodoxEaster } from "easter-date.js";
// CommonJS
const { getWesternEaster, getOrthodoxEaster } = require('easter-date.js');

and pass the desired year as an argument:

getWesternEaster(2024); 
// Output: { day: 31, month: 3, year: 2024 }

getOrthodoxEaster(2024); 
// Output: { day: 5, month: 5, year: 2024 }

Run Locally

Clone the project

  git clone https://github.com/42proger/easter-date.js

Go to the project directory

  cd easter-date.js

Install dependencies

  npm install

Run a compile

  npm run build

Running Tests

To run the tests, install the required dependencies and run the following command:

  npm run test

License

MIT

easter-date.js's People

Contributors

42proger avatar

Stargazers

jist avatar Igr avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.