1.2.4 • Published 3 years ago

ethio-qalendar v1.2.4

Weekly downloads
45
License
MIT
Repository
github
Last release
3 years ago

ethio-Qalendar

Convert Ethiopian date to both Gregorian date and Julian day number (JDN) and vice versa.

Features

  • Ethiopian Date to Gregorian Date conversion.
  • Gregorian Date to Ethiopian Date conversion.
  • Ethiopian Date to Julian Day Number (Jdn) conversion.
  • Gregorian Date to Julian Day Number (Jdn) conversion.
  • Julian Day Number (Jdn) to Ethiopian Date conversion.
  • Julian Day Number (Jdn) to Gregorian Date conversion.

Usage

$ npm i ethio-qalendar
const ethioQalendar = require('ethio-Qalendar');
// From Gregorian to Ethiopian calendar.
console.log(ethioQalendar.toEthiopian(2020, 2, 24));
// Object {day: 16,month: 6, year: 2012}

// From JDN to Ethiopian Date.
console.log(ethioQalendar.jdnToEthiopian(2458903.5));
// Object {day: 16,month: 6, year: 2012}

// From Ethiopian Date to JDN.
console.log(ethioQalendar.ethiopianToJdn(2012, 6, 16));
// Number 2458903.5

Build

First clone the project from github:

git clone git://github.com/elias-ela/ethio-Qalendar.git
cd ethio-Qalendar

Install the project dependencies:

$ npm i

Then, the project can be build by executing the build script via npm:

$ npm run build

This will build the library ethioQalendar.js from the source files and put them in the folder build.

Test

To execute tests for the library, install the project dependencies once:

$ npm i

Then, the tests can be executed:

$ npm test

A little bit about Julian Dates

A Julian date is defined to be the number of days elapsed since noon on January 1, 4713 BCE. Following the astronomical convention, a Julian day is defined to start at 12pm (noon).

Calendar DateJulian Date
January 1, 4713 B.C.E., at 12pm0
January 2, 4713 B.C.E., at 12pm1

Note: Julian values must be in the range -1095 to 1827933925, which corresponds to calendar dates 1 Jan 4716 B.C.E. and 31 Dec 5000000 (5M this is not a joke!), respectively.

License

MIT

Author

Elias Feleke eliasfeleke5@gmail.com