You are here

public static function DatexFormatter::isLeap in Datex 7

Returns non zero if given year is a leap year.

Algorithm author Amin Saeedi <amin.w3dev@gmail.com>, Find him on github! @link http://github.org/amsa

1 call to DatexFormatter::isLeap()
DatexFormatter::formatPHP in datex_api/datex_api_classes.inc
Formats a date according to format given.

File

datex_api/datex_api_classes.inc, line 452
API and helper functions used by other datex modules.

Class

DatexFormatter
Date tools for Jalali Dates.

Code

public static function isLeap($year_value) {
  return array_search(($year_value + 2346) % 2820 % 128, array(
    5,
    9,
    13,
    17,
    21,
    25,
    29,
    34,
    38,
    42,
    46,
    50,
    54,
    58,
    62,
    67,
    71,
    75,
    79,
    83,
    87,
    91,
    95,
    100,
    104,
    108,
    112,
    116,
    120,
    124,
    0,
  ));
}