Merge branch 'fix-leap-year-calculation' into 'develop'

Fixed month_have_days(), wrong calculation for leap year.

See merge request artica/pandorafms!1692
This commit is contained in:
vgilc 2018-08-17 08:24:33 +02:00
commit 3ff740998c
1 changed files with 3 additions and 3 deletions

View File

@ -1278,16 +1278,16 @@ sub month_have_days($$) {
if ( $year <= 1752 ) {
# Note: Although September 1752 only had 19 days,
# they were numbered 1,2,14..30!
if (1752 == $year && 9 == $month) {
if (1752 == $year && 8 == $month) {
return 19;
}
if (2 == $month && 0 == $year % 4) {
if (1 == $month && 0 == $year % 4) {
return 29;
}
}
else {
#Check if Leap year
if (2 == $month && 0 == $year % 4 && 0 == $year%100
if (1 == $month && 0 == $year % 4 && 0 == $year%100
|| 0 == $year%400) {
return 29;
}