Last updated:
0 purchases
libcalendar
Calendar Conversion Library for Dart #
This library defines the following methods for calendar conversion:
fromGregorianToCJDN()
Gregorian calendar to Chronological Julian Day Number (CJDN) conversion.
fromCJDNtoGregorian()
Chronological Julian Day Number (CJDN) to Gregorian calendar conversion.
fromIslamicToCJDN()
Islamic calendar to Chronological Julian Day Number (CJDN) conversion.
fromCJDNtoIslamic()
Chronological Julian Day Number (CJDN) to Islamic calendar conversion.
fromGregorianToIslamic()
Gregorian calendar to Islamic calendar conversion.
fromIslamicToGregorian()
Islamic calendar to Gregorian calendar conversion.
fromGregorianToJulianDate()
Gregorian calendar to Julian Date conversion.
fromJulianDateToGregorian()
Julian Date to Gregorian calendar conversion.
How to use #
Open your pubspec.yaml file and add this entry:
libcalendar: ^0.2.0
copied to clipboard
Then run pub get.
Import this library into your code:
import 'package:libpray/libcalendar.dart';
copied to clipboard
A simple usage example:
import 'package:libcalendar/libcalendar.dart';
void main() {
// September 7th, 2010 in Gregorian.
final int year = 2010;
final int month = 9;
final int day = 7;
// Convert to CJDN.
final int cjdn = fromGregorianToCJDN(year, month, day);
print('September 7th, 2010 in CJDN: $cjdn');
// Convert to Islamic.
final DateTime islamic = fromGregorianToIslamic(year, month, day);
print('September 7th, 2010 in Islamic: ${islamic.day}/${islamic.month}/${islamic.year}');
}
copied to clipboard
The output should be as follows:
September 7th, 2010 in CJDN: 2455447
September 7th, 2010 in Islamic: 28/9/1431
copied to clipboard
Features and Bugs #
Please file feature requests and bugs at the issue tracker.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.