"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.
// Copyright 2012 ETC (2020 GC) Nabute. All rights reserved.// Use of this source code is governed by MIT license, which can be found// in the LICENSE file./// An Example of using the package to create and manipulate Ethiopian Date and/// Time with the unique Calendar system which includes the way ethiopians/// use to find movable feasts and holiday.import { EtDatetime, ETC, BahireHasab, ConvertToEthiopic } from'..';/** * Ethiopian Datetime Module [EtDatetime] */constnow:EtDatetime=newEtDatetime(); // => 2012-07-28 17:18:31.466constnowDate=now.date; // => {year: 2012, month: 7, day: 28}constnowTIme=now.time; // => {h: 17, m: 18, s: 31}constcovidFirstConfirmed:EtDatetime=newEtDatetime(2012,7,4);constcovidFirstConfirmedEpoch:EtDatetime=newEtDatetime(covidFirstConfirmed.moment);// let covidFirstDeath: EtDatetime = EtDatetime.parse("2012-07-26 23:00:00");/// Comparison of two EtDatetime Instances// Duration daysWithOutDeath = covidFirstConfirmed.difference(covidFirstDeath);// daysWithOutDeath.inDays); // 22 days// assert(covidFirstDeath.isAfter(covidFirstConfirmed), true);// assert(covidFirstDeath.isBefore(now), true);covidFirstConfirmed.isAtSameMomentAs(covidFirstConfirmedEpoch);/** * Ethiopian Calendar Module [ETC] */constethiopianCalendar:ETC=newETC(2011,13,4);///ethiopianCalendar.monthDays(true,true); // Iterable Object of the given monthethiopianCalendar.monthDays(); // => [2012, 7, 1, 1]// [year, month, dateNumber, dateNameIndex], Monday as First weekdayconstnextmonth=ethiopianCalendar.nextMonth; // => ETC instance of nextMonth, same yearconstpreviousmonth=ethiopianCalendar.prevYear; // => ETC instance of prevYear, same month/** * Bahire Hasab Module [BahireHasab] */constbh:BahireHasab=newBahireHasab(2011);// let bh: BahireHasab = new BahireHasab(); // Get's the current yearbh.getEvangelist(true); // => ሉቃስbh.getSingleBealOrTsom('ትንሳኤ'); // {month: ሚያዝያ, date: 20}constallFastings=bh.allAtswamat; // => List of All fasting and Movable holidays/** * Arabic or English number (1,2,3...) to Ethiopic or GE'EZ number Convertor */const testNums: number[] = [1, 10, 15, 20, 25, 78, 105, 333, 450, 600, 1000, 1001, 1010, 1056, 1200, 2013, 9999, 10000];
for (constnumof testNums) { console.log(ConvertToEthiopic(num)); // [፩, ፲, ፲፭, ፳, ፳፭, ፸፰, ፻፭, ፫፻፴፫, ፬፻፶, ፮፻, ፲፻, ፲፻፩, ፲፻፲, ፲፻፶፮, ፲፪፻, ፳፻፲፫, ፺፱፻፺፱, ፻፻]
}/** * Conversion from any calendar (for instance, from Gregorian) into Ethiopian Calendar. */constgregorian1:number=Date.now();constethiopian1:EtDatetime=newEtDatetime(gregorian1);console.log(`Gregorian := ${new Date(gregorian1).toISOString()} is equivalent to Ethiopian ${ethiopian1.toIso8601String()}`);
// Gregorian := 2020-09-22T22:43:33.077Z is equivalent to Ethiopian 2013-01-12T22:43:33.077/** * Conversion from Ethiopian Calendar into any calendar (for instance, to Gregorian). */constethiopian:EtDatetime=newEtDatetime();constgregorian:Date=newDate(ethiopian.moment);console.log(`Ethiopian ${ethiopian.toIso8601String()} is equivalent to Gregorian := ${gregorian.toISOString()}`);// Ethiopian 2013-01-12T22:43:33.078 is equivalent to Gregorian := 2020-09-22T22:43:33.078Zconsole.log(`Ethiopian EPOCH := ${ethiopian.moment}`); // Ethiopian EPOCH := 1600814613078console.log(`Gregorian EPOCH := ${gregorian.valueOf()}`); // Gregorian EPOCH := 1600814613078