Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feb 29, 2000 is an invalid date - it never happened #22

Open
birthdaybook opened this issue Jan 1, 2018 · 0 comments
Open

Feb 29, 2000 is an invalid date - it never happened #22

birthdaybook opened this issue Jan 1, 2018 · 0 comments

Comments

@birthdaybook
Copy link

Correction follows: added in this fact - Years divisible by 400 are NOT leap years.

_getNumberOfDaysOfMonth: function(iMonth, iYear)
{
	var apo = this;
	var iArrMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
	iArrLeapYearMonthDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	if(iYear % 4 === 0 && iYear % 400 != 0)
		return iArrLeapYearMonthDays[iMonth];
	else
		return iArrMonthDays[iMonth];
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant