Permalink
Browse files

Date.isLeapYear() Optimization.

Doenst create a new date instance to see if the year is a leap year anymore.
  • Loading branch information...
Fábio M. Costa
Fábio M. Costa committed May 17, 2009
1 parent 081270a commit 2d99ae71626722d37c99eb0ed805a418b8430119
Showing with 1 addition and 1 deletion.
  1. +1 −1 Source/Native/Date.js
View
@@ -269,7 +269,7 @@ $extend(Date, {
},
isLeapYear: function(yr){
return new Date(yr , 1, 29).getDate() == 29;
return ((yr % 4 == 0) && (yr % 100 != 0)) || (yr % 400 == 0);
},
fixY2K: function(d){

0 comments on commit 2d99ae7

Please sign in to comment.