hijri 0.0.13

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

Hijri

Umm Alqura Hijri Calendar Converter

Usage

//Suppose current gregorian data/time is: Mon May 29 00:27:33  2018
  var _today = new ummAlquraCalendar.now();
  print(_today.hYear); // 1439
  print(_today.hMonth); // 9
  print(_today.hDay); // 14
  print(_today.hDay); // 14
  // Get month length in days
  print(_today.lengthOfMonth); // 30 days
  print(_today.toFormat("MMMM dd yyyy")); //Ramadan 14 1439
From Gregorian to Ummalqura
  var h_date = new ummAlquraCalendar.fromDate(new DateTime(2018, 11, 12));
  print(h_date.toString()); //04/03/1440H
  print(h_date.shortMonthName); //Rab1
  print(h_date.longMonthName); //Rabi' al-awwal
  print(h_date.lengthOfMonth); // 29 days
check date is valid
  // 
  var _check_date = new ummAlquraCalendar();
  _check_date.hYear = 1439;
  _check_date.hMonth = 11;
  _check_date.hDay = 30;
  print(_check_date.isValid()); // false -> This month is only 29 days
From Ummalqura to Gregorian
  //From Ummalqura to Gregorian
  var g_date = new ummAlquraCalendar();
  print(g_date.hijriToGregorian(1439, 12, 11)); //2018-08-22 00:00:00.000
Format
  var _format = new ummAlquraCalendar.now();
  print(_format.fullDate()); //Thulatha, Ramadan 14, 1439 h
  print(_format.toFormat("mm dd yy")); //09 14 39
Compare
  //Suppose current hijri data is: Thulatha, Ramadan 14, 1439 h
  print(_today.isAfter(1440, 11, 12)); // false
  print(_today.isBefore(1440, 11, 12)); // true
  print(_today.isAtSameMomentAs(1440, 11, 12)); // false
  

Changelog

0.0.1

  • Initial version

example/main.dart

import 'package:hijri/umm_alqura_calendar.dart';

void main() {
  //Suppose current gregorian data/time is: Mon May 29 00:27:33  2018
  ummAlquraCalendar _today = new ummAlquraCalendar.now();
  _today.currentLocale = 'ar';
  print(_today.hYear); // 1439
  print(_today.hMonth); // 9
  print(_today.hDay); // 14
  print(_today.hDay); // 14
  // Get month length in days
  print(_today.lengthOfMonth); // 30 days
  print(_today.toFormat("MMMM dd yyyy")); //Ramadan 14 1439
  print(" 10 months from now ${new ummAlquraCalendar.addMonth(1439, 12)
      .toString()}"); //Ramadan 14 1439

  //From Gregorian to Ummalqura
  var h_date = new ummAlquraCalendar.fromDate(new DateTime(2018, 11, 12));

  print(h_date.toString()); //04/03/1440H
  print(h_date.shortMonthName); //Rab1
  print(h_date.longMonthName); //Rabi' al-awwal
  print(h_date.lengthOfMonth); // 29 days

  // check date is valid
  var _check_date = new ummAlquraCalendar()
    ..hYear = 1430
    ..hMonth = 09
    ..hDay = 8
    ..currentLocale = 'ar';
  print(_check_date.isValid()); // false -> This month is only 29 days
  print(_check_date.fullDate()); // false -> This month is only 29 days

  //From Ummalqura to Gregorian
  var g_date = new ummAlquraCalendar();
  print(g_date.hijriToGregorian(1439, 12, 11)); //2018-08-22 00:00:00.000

  //Format
  var _format = new ummAlquraCalendar.now()..currentLocale = 'ar';
  ;
  print(_format.fullDate()); //Thulatha, Ramadan 14, 1439 h
  print(_format.toFormat("mm dd yy")); //09 14 39
  print(_format.toFormat("-- DD, MM dd --")); //09 14 39

  //Compare
  //Suppose current hijri data is: Thulatha, Ramadan 14, 1439 h
  print(_today.isAfter(1440, 11, 12)); // false
  print(_today.isBefore(1440, 11, 12)); // true
  print(_today.isAtSameMomentAs(1440, 11, 12)); // false
}

Use this package as a library

1. Depend on it

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


dependencies:
  hijri: "^0.0.13"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:hijri/umm_alqura_calendar.dart';

      import 'package:hijri/umm_alqura_array.dart';
  
Version Uploaded Documentation Archive
0.0.13 Jun 3, 2018 Go to the documentation of hijri 0.0.13 Download hijri 0.0.13 archive
0.0.12 Jun 3, 2018 Go to the documentation of hijri 0.0.12 Download hijri 0.0.12 archive
0.0.11 Jun 3, 2018 Go to the documentation of hijri 0.0.11 Download hijri 0.0.11 archive
0.0.10 Jun 3, 2018 Go to the documentation of hijri 0.0.10 Download hijri 0.0.10 archive
0.0.9 Jun 2, 2018 Go to the documentation of hijri 0.0.9 Download hijri 0.0.9 archive
0.0.8 Jun 2, 2018 Go to the documentation of hijri 0.0.8 Download hijri 0.0.8 archive
0.0.7 Jun 2, 2018 Go to the documentation of hijri 0.0.7 Download hijri 0.0.7 archive
0.0.6 Jun 2, 2018 Go to the documentation of hijri 0.0.6 Download hijri 0.0.6 archive
0.0.5 Jun 2, 2018 Go to the documentation of hijri 0.0.5 Download hijri 0.0.5 archive
0.0.4 May 29, 2018 Go to the documentation of hijri 0.0.4 Download hijri 0.0.4 archive

All 13 versions...

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures 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]
0 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]
46
Learn more about scoring.

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Suggestions

  • Fix dependencies in pubspec.yaml.

    Running pub upgrade failed with the following output:

    ERR: The current Dart SDK version is 2.0.0-dev.63.0.
     
     Because hijri requires SDK version >=1.19.0 <=2.0.0-dev.58.0, version solving failed.
    
  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Fix dependencies in pubspec.yaml.

  • 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/umm_alqura_calendar.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <=2.0.0-dev.58.0