Giter Club home page Giter Club logo

hijriyah_indonesia's Introduction

Hijriyah Indonesia

Hijriyah Calendar Converter

Usage

//Suppose current gregorian data/time is: Fri September 9 00:27:33  2022
  var _today = Hijriyah.now();
  print(_today.hYear); // 1444
  print(_today.hMonth); // 2
  print(_today.hDay); // 14
  print(_today.getDayName()); // 14
  // Get month length in days
  print(_today.lengthOfMonth); // 30 days
  print(_today.toFormat("MMMM dd yyyy")); //Shafar 14 1444
Usage convert
Hijriyah.fromDate(DateTime.parse(dateTime.toString()).toLocal()).toFormat("dd MMMM yyyy");
Change Local
  Hijriyah.setLocal(locale);
Add New Locale
  Hijriyah.addLocale(locale, {
    'long': ...,
    'short': ...,
    'days': ...,
    'short_days': ...
  });
  Hijriyah.setLocal(locale);
From Gregorian to Ummalqura
var h_date = Hijriyah.fromDate(DateTime(2018, 11, 12));
print(h_date.toString()); //04/03/1444H
print(h_date.getShortMonthName()); //Rab
print(h_date.getLongMonthName()); //Rabiul Awwal
print(h_date.lengthOfMonth); // 29 days
Check if date is valid
  //
  var _check_date = Hijriyah();
  _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 = Hijriyah();
  print(g_date.hijriToGregorian(1444, 7, 27)); //2022-09-9 00:00:00.000
Format
  var _format = Hijriyah.now();
  print(_format.fullDate()); //Selasa, 14 Shaffar , 1444 h
  print(_format.toFormat("mm dd yy")); //09 14 39
Compare
  //Suppose current hijri data is: TSelasa, 14 Shaffar , 1444 h
  print(_today.isAfter(1440, 11, 12)); // false
  print(_today.isBefore(1440, 11, 12)); // true
  print(_today.isAtSameMomentAs(1440, 11, 12)); // false

hijriyah_indonesia's People

Contributors

putraxor avatar taufiqjack avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

putraxor

hijriyah_indonesia's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.