hijridatetime Hijri Date Time Extention, التاريخ الهجري

  1. Requirements
  2. Install
  3. Usage
  4. Changelog

دعم التاريخ الهجري في yii

HijriDateTime extension is a convenient and complete solution for users who want to use Hijri date in their projects.

To convert Gregorian calendar to Hijri (Islamic) calendar . --- With version 1.0.1 you can translate it to your language.

-- It support ar, en, fr languages

This extensions is 100% compatible with "Umm al-Qura" formal calendar in Saudi Arabia and the Muslim world.

Requirements

Yii 1.1 or above, PHP 5

Install

  1. Extract to extensions directory
  2. copy the messages folder to you protected folder
  3. Add as component to main config
// To sopport I18N translation ->> folder messages/ar
    'language' => 'ar', // for now ar, en, fr languages are provided ' thanks to abennouna
    
    // application components
    'components' => array(
                /*---- other components*/
        // Hijri date
        'hdate' => array(
            'class' => 'ext.hdate.HijriDateTime',
        ),

Usage

see Date Function in PHP for the full date format

Yii::app()->hdate->date("H:i A l, d F Y",time()) // formatting is like date function
// will return  الجمعة, 08 ربيع الأول 1432 06:10 صباحاً

To get an array of month, day, year in Hijri

Yii::app()->hdate->GeToHijr(20, 02,  1976)
// will return Array Hijri date[int month, int day, int year]

To parse about any English textual datetime description into a Hijri format if no format the date returned will be Hijri d-m-Y

Yii::app()->hdate->strToHijri("19 June 2012")
// will return a Date in Hijri d-m-Y if not formated
//-------- Or -----------
Yii::app()->hdate->strToHijri("19 June 2012", "l, d F Y H:i A")
// will return a Date in Hijri as formated like الجمعة, 08 ربيع الأول 1432 06:10 صباحاً 

Changelog

v 1.0.1 adding the translation files and improving the ext. (thanks to abennouna)

4 0
6 followers
1 079 downloads
Yii Version: 1.1
License: GPL-2.0
Category: Date and Time
Developed by: Abdulrhman A
Created on: May 2, 2012
Last updated: 12 years ago

Downloads

show all

Related Extensions