Abushakir (ባሕረ ሃሳብ)
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.
What does it mean?
"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.
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.
Documentation
Abushakir
Demo
Ethiopian calendar
Prerequisites
Before you begin, ensure you have met the following requirements:
Getting started
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
abushakir: "^1.0.0"
In your library add the following import:
import 'package:abushakir/abushakir.dart' ;
Example
EtDatetime now = new EtDatetime .now ();
print (now.date);
print (now.time);
EtDatetime covidFirstConfirmed = new EtDatetime (year: 2012 , month: 7 , day: 4 );
EtDatetime covidFirstConfirmedEpoch =
new EtDatetime .fromMillisecondsSinceEpoch (covidFirstConfirmed.moment);
EtDatetime covidFirstDeath = EtDatetime .parse ("2012-07-26 23:00:00" );
Duration daysWithOutDeath = covidFirstConfirmed.difference (covidFirstDeath);
assert (daysWithOutDeath.inDays == -22 , true );
assert (covidFirstDeath.isAfter (covidFirstConfirmed), true );
assert (covidFirstDeath.isBefore (now), true );
assert (covidFirstConfirmed.isAtSameMomentAs (covidFirstConfirmedEpoch), true );
ETC ethiopianCalendar = new ETC(year: 2012 , month: 7 , day: 4 );
print (ethiopianCalendar.monthDays (geezDay: true , weekDayName:true ));
print (ethiopianCalendar.monthDays ().toList ()[0 ]);
print (ethiopianCalendar.nextMonth);
print (ethiopianCalendar.prevYear);
BahireHasab bh = BahireHasab (year: 2011 );
print (bh.getEvangelist (returnName: true ));
print (bh.getSingleBealOrTsom ("ትንሳኤ" ));
bh.allAtswamat;
var input= [1 , 10 , 15 , 20 , 25 , 78 , 105 , 333 , 450 , 600 , 1000 , 1001 , 1010 , 1056 , 1200 , 2013 , 9999 , 10000 ];
for (var arabic in input) {
print (ConvertToEthiopic (arabic));
}
DateTime gregorian1 = new DateTime .now ();
EtDatetime ethiopian1 = new EtDatetime .fromMillisecondsSinceEpoch (gregorian1.millisecondsSinceEpoch);
print ("Gregorian := ${gregorian1.toString()} is equivalent to Ethiopian ${ethiopian1.toString()} " );
EtDatetime ethiopian = new EtDatetime .now ();
DateTime gregorian = new DateTime .fromMillisecondsSinceEpoch (ethiopian.moment);
print ("Ethiopian ${ethiopian.toString()} is equivalent to Gregorian := ${gregorian.toString()} " );
print ("Ethiopian EPOCH := ${ethiopian.moment} " );
print ("Gregorian EPOCH := ${gregorian.millisecondsSinceEpoch} " );
For further implementation example see this flutter application
Contributors
Thanks to the following people who have contributed to this project:
Contact
If you want to contact me you can reach me at <nabute925@gmail.com>.
License
This project is licensed under the MIT License - see the LICENSE.md file for details