umstartyear
umstartyear
the Um Al-Qura Calendar start year
Hijri Calendar Class is group of functions that gets the Hijri Calendar and converts it to other calendars
This class contains functions work similar to calendar functions in PHP but it is work with Hijri Calendar. The Class has two algorithms to calculate the Hijri Date
$hijri_settings=array(
'langcode'=>'ar',
'defaultformat'=>'_j _M _Yهـ',
'umalqura'=> TRUE,
'adj_data'=> array(1426 => 57250, 1429 => 57339,),
'grdate_format' => 'j M Y',
);
__construct(array $settings = array()) : \hijri\Calendar
Create new hijri\Calendar object according to given settings
array | $settings | Optional array contains one or more settings of the hijri calendar object these settings are: |
hijri\Calendar object with the specified settings.
jd2hijri(integer $julianday, integer $hy, integer $hm, integer $hd, integer $hz) : void
Returns Hijri date from julianday
integer | $julianday | the julianday |
integer | $hy | variable to store Hijri year |
integer | $hm | variable to store Hijri month |
integer | $hd | variable to store Hijri day in month |
integer | $hz | variable to store Hijri day in year (starting from 0) |
GregorianToHijri(integer $year, integer $month, integer $day) : array
Return Hijri Date from Gregorian date
integer | $year | the Gregorian year |
integer | $month | the Gregorian month |
integer | $day | the Gregorian day |
An array contains Hijri Date: 'y' key for year,'m' key for month,'d' key for day
HijriToGregorian(integer $year, integer $month, integer $day) : array
Return Gregorian Date from Hijri date
integer | $year | the Hijri year |
integer | $month | the Hijri month |
integer | $day | the Hijri day |
An array contains Gregorian Date: 'y' key for year,'m' key for month,'d' key for day
JulianToHijri(integer $year, integer $month, integer $day) : array
Returns Hijri Date from Julian date
integer | $year | the Julian year |
integer | $month | the Julian month |
integer | $day | the Julian day |
An array contains Hijri Date: 'y' key for year,'m' key for month,'d' key for day
HijriToJulian(integer $year, integer $month, integer $day) : array
Returns Julian Date from Hijri date
integer | $year | the Hijri year |
integer | $month | the Hijri month |
integer | $day | the Hijri day |
An array contains Julian Date: 'y' key for year,'m' key for month,'d' key for day
WesternToHijri(integer $year, integer $month, integer $day) : array
Returns Hijri Date from Western date
The Western date is Julian date before 1582 and Gregorian after
integer | $year | the Western year |
integer | $month | the Western month |
integer | $day | the Western day |
An array contains Hijri Date: 'y' key for year,'m' key for month,'d' key for day
HijriToWestern(integer $year, integer $month, integer $day) : array
Return Western Date from Hijri date
The Western date is Julian date before 1582 and Gregorian after
integer | $year | the Hijri year |
integer | $month | the Hijri month |
integer | $day | the Hijri day |
An array contains Western Date: 'y' key for year,'m' key for month,'d' key for day
days_in_month(integer $month, integer $year, boolean $umalqura = null) : integer
Returns count of days in month (29 or 30)
integer | $month | the Hijri month |
integer | $year | the Hijri year |
boolean | $umalqura | TRUE to use Um Al-Qura, FALSE to use Tabular, defaults from Calendar object |
count of days in month 29 or 30
month_name(string $month, string $langcode = 'ar', boolean $short = FALSE) : string
Returns the hijri month name in 20 languages
string | $month | the month number |
string | $langcode | the language ISO code |
boolean | $short | return short names of months for European languages |
Hijri month name
leap_year(integer $year, boolean $umalqura = null) : integer
Return 1 if the given year is leap, 0 else
integer | $year | the Hijri Year |
boolean | $umalqura | TRUE to use Um Al-Qura, FALSE to use Tabular, defaults from Calendar object |
1 if the given year is leap(have 355 days), 0 else
checkHijriDate(integer $year, integer $month, integer $day) : boolean
Checks the given Hijri date, returns true is the date is correct
integer | $year | the Hijri year |
integer | $month | the Hijri month |
integer | $day | the Hijri day |
TRUE if the given date is correct, FALSE else
get_umalquradata(boolean $with_adj = TRUE, boolean $return_array = FALSE) : array|boolean
Loads Um Al-Qura data and apply the adjustments
boolean | $with_adj | TRUE (default) to apply adjustments, FALSE to not |
boolean | $return_array | True to return umdata array, False to load umdata to $umdata variable |
array contains Um Al-Qura data if $return_array =true, bool true else