AbushakirJs (ባሕረ ሃሳብ)
"Bahire Hasab /'bəhrɛ həsəb'/ " simply means "An age with a descriptive and chronological number". In some books it can also be found as "Hasabe Bahir", in a sense giving time an analogy, resembling a sea.
The words Bahire Hasab originate from the ancient language of Ge'ez, ( Arabic: Abu Shakir) is a time-tracking method, devised by the 12th pope of Alexandria, Pope St. Dimitri.
This package allows developers to implement Ethiopian Calendar and Datetime System in their application(s)`.
This package is implemented using the UNIX EPOCH which means it's not a conversion of any other calendar system into Ethiopian, for instance, Gregorian Calendar.
Unix Epoch is measured using milliseconds since 01 Jan, 1970 UTC. In UNIX EPOCH leap seconds are ignored.
Getting started
npm i abushakir
Import it
import { EtDatetime, ETC, BahireHasab, ConvertToEthiopic } from 'abushakir';
Documentation
AbushakirJs
Demo
Ethiopian Calendar
Example
import { EtDatetime, ETC, BahireHasab, ConvertToEthiopic } from '..';
const now: EtDatetime = new EtDatetime();
const nowDate = now.date;
const nowTIme = now.time;
const covidFirstConfirmed: EtDatetime = new EtDatetime(2012, 7, 4);
const covidFirstConfirmedEpoch: EtDatetime = new EtDatetime(covidFirstConfirmed.moment);
covidFirstConfirmed.isAtSameMomentAs(covidFirstConfirmedEpoch);
const ethiopianCalendar: ETC = new ETC(2011, 13, 4);
ethiopianCalendar.monthDays(true, true);
ethiopianCalendar.monthDays();
const nextmonth = ethiopianCalendar.nextMonth;
const previousmonth = ethiopianCalendar.prevYear;
const bh: BahireHasab = new BahireHasab(2011);
bh.getEvangelist(true);
bh.getSingleBealOrTsom('ትንሳኤ');
const allFastings = bh.allAtswamat;
const testNums: number[] = [1, 10, 15, 20, 25, 78, 105, 333, 450, 600, 1000, 1001, 1010, 1056, 1200, 2013, 9999, 10000];
for (const num of testNums) {
console.log(ConvertToEthiopic(num));
}
const gregorian1: number = Date.now();
const ethiopian1: EtDatetime = new EtDatetime(gregorian1);
console.log(`Gregorian := ${new Date(gregorian1).toISOString()} is equivalent to Ethiopian ${ethiopian1.toIso8601String()}`);
const ethiopian: EtDatetime = new EtDatetime();
const gregorian: Date = new Date(ethiopian.moment);
console.log(`Ethiopian ${ethiopian.toIso8601String()} is equivalent to Gregorian := ${gregorian.toISOString()}`);
console.log(`Ethiopian EPOCH := ${ethiopian.moment}`);
console.log(`Gregorian EPOCH := ${gregorian.valueOf()}`);
Contact
If you want to contact me you can reach me at daniel@ibrave.dev.
License
This project is licensed under the MIT License - see the LICENSE.md file for details