Giter Site home page Giter Site logo

yii2-hijridatetime's Introduction

Hijri Date Time

Hijri Date Time extension is a convenient and complete solution for users who want to use Hijri date in their projects and convert Gregorian calendar to Hijri (Islamic) calendar. This extensions is 100% compatible with "Umm al-Qura" formal calendar in Saudi Arabia and the Muslim world.

It support Arabic, English, France, and Indonesia languages.

This extension is made by Abdulrhman Alkhodiry & Abdul-Aziz Al-Oraij. I just add some addition for compatible with Yii2 and wrap it to composer.

The original source here

Installation

The preferred way to install this extension is through composer.

Just run

composer require biladina/yii2-hijridatetime

Usage

Once the extension is installed, simply use it in your code by :

<?php

use biladina\hijridatetime\HijriDateTime;

// Choose Your Format Like 'l ، j F ، Y'
// Y => Hijri Year [1442]
// F => Hijri Month Arabic Name [رمضان]
// j => Hijri Day Number [27]
// l => Arabic Day Name [الجمعة]
// m => Hijri Month Number [09]
// a => 'ص'
// A => 'صباحًا'
// H => Hour
// i => Minutes
// s => Seconds

$hijri = new HijriDateTime();

$hijri->date("H:i A l, d F Y",time()) // formatting is like date function
// will return 16:16 PM Jum'at, 01 Ramadhan 1441

$hijri->GeToHijr(20, 02,  1976)
// will return Array Hijri date[int month, int day, int year]

$hijri->strToHijri("24 April 2020")
// will return a Date in Hijri d-m-Y if not formated
//-------- Or -----------
$hijri->strToHijri("24 April 2020 15:00:00", "l, d F Y H:i A")
// will return a Date in Hijri as formated like Jum'at, 01 Ramadhan 1441 15:00 PM

If you want to change language, open your config main.php file, change the languange id.

return [
	'language' => 'id-ID', // 'en-US' for English, 'ar' for Arabic, 'fr' for France, 'id-ID' for Indonesia
]

yii2-hijridatetime's People

Contributors

biladina avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mubarakcoded

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.