umstartyear
umstartyear
the Um Al-Qura Calendar start year
Hijri CalendarAdjustment Class is group of functions that help to get and correct adjustments to Umm Al-Qura Calendar
to set the default setting of this class use $hijri_settings variable which is an array with this sample structure:
$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\CalendarAdjustment object according to given settings
array | $settings | Array contains one or more settings of the hijri CalendarAdjustment object these settings are:
if not set, the defaults from $hijri_settings global variable will be used. |
hijri\CalendarAdjustment 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_adjdata(boolean $txt = TRUE) : string|array
returns the adjustment data
boolean | $txt | true to return a json encoded array string False to return array. |
string json encoded array adjustment data if $txt is true, or array of adjustment data if $txt if false
check_auto_del(integer $off) : array<mixed,integer>
Returns array of month adjustment must be deleted if the given month adjustment deleted
integer | $off | the index of the month adjustment you want to delete can be given by function month2off |
Array of index of month adjustment must be deleted
check_auto_adj(integer $off, integer $v) : array
Gives you array of adj_data must added if you adjust the given month with the given modified julian day
integer | $off | The index of the month to be adjusted can be given by function month2off |
integer | $v | (modified julian day) of the new start of the month |
Array of adj_data must by applied if the start of month adjusted to the given day
get_possible_starts(integer $month, integer $year) : array
Gets an array of possible starts of Hijri month according to Umm Al-Qura Data and current Adjustments
integer | $month | Hijri month |
integer | $year | Hijri year |
An array contains two numeric indexed variables (arrays) with these keys:
get_current_adjs() : array
Gives you an array of current Umm Al-Qura adjustments
An array contains (arrays) of current adjustments with these keys:
add_adj(integer $month, integer $year, integer|string $new_month_start) : boolean
Adds or modifies adjustment to the calendar object
integer | $month | the Hijri month |
integer | $year | the year of Hijri month |
integer|string | $new_month_start | the new start of the Hijri Month can be integer (modified julian day) or string (Gregorian date (d/m/yyyy) format) |
TRUE if the succeeded or FALSE if not
this will add the adjustment only to the current object if you want to save it you must use get_adj_txt()
auto_del_info(integer $month, integer $year) : array
Gives information of must delete adjustments if given month adjustment deleted
integer | $month | the Hijri month |
integer | $year | the Hijri Year |
array of must to delete month adjustments, keys are 'month','year'
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