Created
February 25, 2011 22:58
-
-
Save highruned/844675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function add(name, method) { | |
if( !Date.prototype[name] ) { | |
Date.prototype[name] = method; | |
} | |
}; | |
add("isLeapYear", function() { | |
var y = this.getFullYear(); | |
return (y%4==0 && y%100!=0) || y%400==0; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment