Posted By


tomasdev on 06/13/11

Tagged


Statistics


Viewed 157 times
Favorited by 0 user(s)

Leap Year Check


/ Published in: JavaScript
Save to your folder(s)

Extend Date object to have isLeapYear() boolean (true for Leap Years)
Taken from https://raw.github.com/vitch/jquery-methods/master/date.js


Copy this code and paste it in your HTML
  1. Date.prototype.isLeapYear = function() {
  2. var y = this.getFullYear();
  3. return (y%4==0 && y%100!=0) || y%400==0;
  4. };

URL: http://www.tomasdev.com.ar

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.