Date.isleap = function(year){ return ((year % 400) == 0) ? 1 : ((year % 100) == 0) ? 0 : ((year % 4) == 0) ? 1 : 0; } Date.prototype.isleap = function(){ return Date.isleap(this.getFullYear()) } // isleap current year new Date().isleap()
You need to create an account or log in to post comments to this site.