Leap Year Check
Javascript Code
+ 0 likes
Please Register to submit score.
| Average Score | 0.0 (of 0 scores) |
| Date Added | Nov 11, 2009 |
| Last Updated | Nov 11, 2009 |
| Tags | check date detect javascript leap year |
Description
Just a simple script which uses maths to detect whether or not a year is a leap year or not. If the year inputted is then "true" will be returned, if not "false".
To use the script just use
leapYear(date);
e.g.
leapYear(2012);
This function can of course be used within any other function e.g.
alert(leapYear(2012));
Remember to put within <script type="text/javascript"></script> !!
To use the script just use
leapYear(date);
e.g.
leapYear(2012);
This function can of course be used within any other function e.g.
alert(leapYear(2012));
Remember to put within <script type="text/javascript"></script> !!
Javascript Snippet:
Leap Year Check
Posted on Feb 14, 2010 8:32 am
Posted on Feb 14, 2010 8:32 am
Didn't work :S
Javascript Snippet:
Leap Year Check
Posted on Mar 4, 2010 12:59 pm
Posted on Mar 4, 2010 12:59 pm
| Code: |
| function leapCheck(y){y-=2008;if (y < 0){y*=-1;}if((y % 4) == 0){return true;}return false;} |







