Can someone please help with the Jquery to populate "TODATE" if the "FROMDATE" is selected using calender adding exactly 1 year?
eg
if the TODATE selected is 1/1/2011 then FROMDATE must be 31/12/2011(
if the TODATE selected is 1/3/2011 then FROMDATE must be 29/2/2012 (leap year + month last day consideration)
if the TODATE selected is 1/3/2012 then FROMDATE must be 28/02/2013
ANSWER :
Please try with following (I have taken as from date as current date)
var lastdate = new Date();
lastdate.setYear(lastdate.getYear() + 1);
lastdate.setDate(lastdate.getDate() - 1);
0 comments:
கருத்துரையிடுக