Return to Snippet

Revision: 43101
at March 16, 2011 17:11 by root_hacker


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

Initial URL

                                

Initial Description
overflowing day paramter will return date of next month and creates overlapping if we subtract this overlap from 32 we will have the last date of targeted month

Initial Title
Last Date Of Month

Initial Tags

                                

Initial Language
JavaScript