$defaultformat
$defaultformat : string
Hijri Date custom extensions to the PHP DateTime class This handles the Hijri Calendar beside the Gregorian Calendar
This class override PHP DateTime Class to show the Hijri Calendar Date and also showing the Gregorian Calendar Translated to Arabic Language if language set to 'ar' the Hijri Calendar calculated depending of hijri\calendar Class which have two algorithms:
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,)
);
$hcal : \hijri\Calendar
$s_hcal : \hijri\Calendar
__construct(string $time = 'now', \DateTimeZone $timezone = null, string $langcode = null, \hijri\Calendar $hijriCalendar = null)
Constructs a new instance of datetime, expanded to include an argument to inject the user context and modify the timezone to the users selected timezone if one is not set.
string | $time | String in a format accepted by strtotime() default is 'now' |
\DateTimeZone | $timezone | Time zone of the time default is ini timezone |
string | $langcode | set the language which can be any of supported languages in Calendar object if not set the default is 'ar' |
\hijri\Calendar | $hijriCalendar | Calendar object which used for calendar converting, if not set the class will create new Calendar object with default settings |
** File not found : 'examples/monthCalendar.php' **
createFromHijri(integer $year, integer $month, integer $day, \DateTimeZone $timezone = null, string $langcode = null, \hijri\Calendar $hijriCalendar = null) : self
Create DateTime object from hijri date
integer | $year | the hijri year |
integer | $month | the hijri month |
integer | $day | the hijri day |
\DateTimeZone | $timezone | Optional the time zone object |
string | $langcode | Optional the langcode |
\hijri\Calendar | $hijriCalendar | Optional the Calendar object |
datetime object from the given hijri date
format(string $format = null, boolean $force_hijri = FALSE) : string
Formats the current date time into the specified format, this method overrides Datetime original method, if format characters are with "_" underscore prefix it will return hijri equivalent, if langcode set to 'ar' it will return Arabic translated date for Hijri or Gregorian Calendars
string | $format | Optional format to use for output The following characters are recognized to output Hijri Calendar in the format parameter string
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
boolean | $force_hijri | force the returned date to be Hijri if the $format does not contain underscore (_) |
Formatted date time