Posted By

root_hacker on 03/16/11


Tagged


Versions (?)

Last Date Of Month


 / Published in: JavaScript
 

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

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

Report this snippet  

You need to login to post a comment.