/** * jDateTime::Constructor * * Pass these parameteres when creating a new instance * of this Class, and they will be used as defaults. * e.g $obj = new jDateTime(false, true, 'Asia/Tehran'); * To use system defaults pass null for each one or just * create the object without any parameters. * * @author Sallar Kaboli * @param $convert bool Converts numbers to Farsi * @param $jalali bool Converts date to Jalali * @param $timezone string Timezone string */ public function __construct($convert = null, $jalali = null, $timezone = null) { if ($jalali !== null) { self::$jalali = (bool) $jalali; } if ($convert !== null) { self::$convert = (bool) $convert; } if ($timezone !== null) { self::$timezone = $timezone; } }
/** * jDateTime::Constructor * * Pass these parameteres when creating a new instance * of this Class, and they will be used as defaults. * e.g $obj = new jDateTime(false, true, 'Asia/Tehran'); * To use system defaults pass null for each one or just * create the object without any parameters. * * @author Sallar Kaboli * @param $convert bool Converts numbers to Farsi * @param $jalali bool Converts date to Jalali * @param $timezone string Timezone string */ public function __construct($convert = null, $jalali = null, $timezone = null) { if ($jalali !== null) { self::$jalali = $jalali === false ? false : true; } if ($convert !== null) { self::$convert = $convert === false ? false : true; } if ($timezone !== null) { self::$timezone = $timezone != null ? $timezone : null; } }