Return to Snippet

Revision: 43100
at March 16, 2011 17:08 by root_hacker

Initial Code
var month = {LastDay : function(Year,Month){ return 32 - new Date(Year,Month,32).getDate();}}
var Year = {IsLeap: function(Year){ return 29 == month.LastDay(Year,1)}};
Year.IsLeap(2000); // returns true
Year.IsLeap(2000); // returns false

Initial URL

Initial Description
date object return date of next month if day parameter overflows

Initial Title
Leap Year Check In Javascript

Initial Tags

Initial Language