دعم التاريخ الهجري في 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.
Yii 1.1 or above, PHP 5
// 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', ),
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 صباحاً
v 1.0.1 adding the translation files and improving the ext. (thanks to abennouna)
Total 3 comments
Thanks for the plugin...
I have added the translations files to the ext. Thank you so much for the great observations.
Kind regards, Abdulrhman A.
Thank you for this extension. It will sure be very handful.
I have two observations:
Leave a comment
Please login to leave your comment.