Merge pull request #4147 from datacompboy/patch-1

Fix ValidateDateTime: check day instead month
This commit is contained in:
Adam Cozzette 2018-01-08 10:40:08 -08:00 committed by GitHub
commit d4afdba83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,9 +80,9 @@ bool ValidateDateTime(const DateTime& time) {
return false;
}
if (time.month == 2 && IsLeapYear(time.year)) {
return time.month <= kDaysInMonth[time.month] + 1;
return time.day <= kDaysInMonth[time.month] + 1;
} else {
return time.month <= kDaysInMonth[time.month];
return time.day <= kDaysInMonth[time.month];
}
}