libcalendar 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 66

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

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}');
}

The output should be as follows:

September 7th, 2010 in CJDN: 2455447
September 7th, 2010 in Islamic: 28/9/1431

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.

Change Log

0.0.1

  • Initial version.
  • <strong>[NEW]: </strong>Gregorian-CJDN conversion.
  • <strong>[NEW]: </strong>Islamic-CJDN conversion.
  • <strong>[NEW]: </strong>Gregorian-Islamic conversion.

0.0.2

  • <strong>[NEW]: </strong>Gregorian-Julian Date conversion.

example/libcalendar_example.dart

import 'package:libcalendar/libcalendar.dart';

void main() {
  // September 7th, 2010 in Gregorian.
  const int year = 2010;
  const int month = 9;
  const 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}');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  libcalendar: "^0.0.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:libcalendar/libcalendar.dart';
  
Version Uploaded Documentation Archive
0.0.2 Apr 11, 2018 Go to the documentation of libcalendar 0.0.2 Download libcalendar 0.0.2 archive
0.0.1 Apr 10, 2018 Go to the documentation of libcalendar 0.0.1 Download libcalendar 0.0.1 archive

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
31 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
66
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:libcalendar/libcalendar.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run dartfmt to format lib/src/calendar_converter.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
logging ^0.11.3 0.11.3+1
meta ^1.1.2 1.1.5
Dev dependencies
test ^0.12.0