summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-10-09 23:39:45 +0100
committerGreg Roach <fisharebest@gmail.com>2013-10-09 23:39:45 +0100
commit9b3c428141d855ed8153963878d6f15b022de0b8 (patch)
tree5a1cb5088f2a6b83928b498e1b16dc69e32fb82a /library
parent744c1cc2f94dafb0ee356bd1a0e662966aa33ec9 (diff)
downloadwebtrees-9b3c428141d855ed8153963878d6f15b022de0b8.tar.gz
webtrees-9b3c428141d855ed8153963878d6f15b022de0b8.tar.bz2
webtrees-9b3c428141d855ed8153963878d6f15b022de0b8.zip
Incorrect calculation for leap years in the Jalali calendar
Diffstat (limited to 'library')
-rw-r--r--library/WT/Date/Jalali.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/WT/Date/Jalali.php b/library/WT/Date/Jalali.php
index cb2492ac07..51b6fbda44 100644
--- a/library/WT/Date/Jalali.php
+++ b/library/WT/Date/Jalali.php
@@ -131,7 +131,10 @@ class WT_Date_Jalali extends WT_Date_Calendar {
}
function IsLeapYear() {
- return (((((($this->y - (($this->y > 0) ? 474 : 473)) % 2820) + 474) + 38) * 682) % 2816) < 682;
+ return in_array(
+ (($this->y + 2346) % 2820) % 128,
+ array(0, 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)
+ );
}
static function YMDtoJD($year, $month, $day) {