final class DatexPersianIntlCalendar in Datex 7.3
Persian implementation of DatexInterface.
Hierarchy
- class \DatexPartialImplementation implements DatexInterface
- class \DatexIntlCalendar implements DatexInterface
- class \DatexPersianIntlCalendar
- class \DatexIntlCalendar implements DatexInterface
Expanded class hierarchy of DatexPersianIntlCalendar
File
- src/
Datex/ DatexPersianIntlCalendar.php, line 11 - Persian implementation of DatexInterface.
View source
final class DatexPersianIntlCalendar extends DatexIntlCalendar {
/**
* Check to see if date granularities given in the array are valid dates.
*/
function validate(array $arr) {
if ((!isset($arr['year']) || empty($arr['year'])) && (!isset($arr['month']) || empty($arr['month'])) && (!isset($arr['day']) || empty($arr['day']))) {
return NULL;
}
$zero = TRUE;
$year = intval($arr['year']);
$month = intval($arr['month']);
$day = intval($arr['day']);
if ($year < 0 || $year === 0 && $zero) {
return t('Year out of range');
}
if ($month < 0 || 12 < $month || $month === 0 && $zero) {
return t('Month out of range');
}
if ($day === 0 && $zero || $day < 0 || 31 < $day || $month > 6 && $day > 30 || $month === 12 && $day > 29) {
return t('Day out of range');
}
return FALSE;
}
/**
* Creates a clone of this object.
*/
function copy() {
return new DatexPersianIntlCalendar($this->timezone, $this->calendar, $this->langCode);
}
protected function formatHook($format, $value) {
return $value;
}
function getBaseYear() {
return 1390;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DatexIntlCalendar:: |
protected | property | ||
DatexIntlCalendar:: |
protected | property | ||
DatexIntlCalendar:: |
private static | property | php's date format modifiers differ from Intl's. This is a mapping of the two. | |
DatexIntlCalendar:: |
private static | property | Some format modifiers are not supported in intl. They are simply removed. | |
DatexIntlCalendar:: |
public | function |
Format this object's date according to format string. Overrides DatexInterface:: |
|
DatexIntlCalendar:: |
private static | function | ||
DatexIntlCalendar:: |
private static | function | ||
DatexIntlCalendar:: |
public | function |
Parses a date string into date and sets this objects date accordingly. Overrides DatexInterface:: |
|
DatexIntlCalendar:: |
public | function |
Set date of this object from a local date. Overrides DatexInterface:: |
|
DatexIntlCalendar:: |
private static | function | ||
DatexIntlCalendar:: |
public | function |
Creates a new DatexIntlCalendar. Overrides DatexPartialImplementation:: |
|
DatexPartialImplementation:: |
protected | property | ||
DatexPartialImplementation:: |
protected | property | ||
DatexPartialImplementation:: |
protected | property | ||
DatexPartialImplementation:: |
protected | property | ||
DatexPartialImplementation:: |
final | function |
Format date parts into an array. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
final | function |
Get name of the calendar, such as gregorian or persian. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
function |
Get two letter language code of this object. Overrides DatexInterface:: |
||
DatexPartialImplementation:: |
protected | function | ||
DatexPartialImplementation:: |
final | function |
Get timestamp of this object. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
function |
Get various list options, such as month names for a form select element. Overrides DatexInterface:: |
||
DatexPartialImplementation:: |
final | function |
Set time on this object. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
final | function |
Set timestamp on this object. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
final protected | function | ||
DatexPartialImplementation:: |
final | function |
Format date time, in gregorian. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
final | function |
Put all day and time parts in an array, in gregorian. Overrides DatexInterface:: |
|
DatexPartialImplementation:: |
final | function |
Set date (in Gregorian) on this object. Overrides DatexInterface:: |
|
DatexPersianIntlCalendar:: |
function |
Creates a clone of this object. Overrides DatexIntlCalendar:: |
||
DatexPersianIntlCalendar:: |
protected | function |
Overrides DatexIntlCalendar:: |
|
DatexPersianIntlCalendar:: |
function |
Overrides DatexIntlCalendar:: |
||
DatexPersianIntlCalendar:: |
function |
Check to see if date granularities given in the array are valid dates. Overrides DatexPartialImplementation:: |