I am using Flex 3.
I want to know that how to get the current date of the next month.
I am facing the problem that if i choose the 31st march, 2011 from datefield, i can't get the result as 30th April, 2011. Same problem with the February Month of the leap year. So please give me help as early as possible.
I want that if i click on the 31st January, 2012 then i got result like 29th February, 2012.
My current code is:
txtdate.text = da.getDate().toString();
txtmonth.text = (da.getMonth()+1).toString();
txtyear.text = da.getFullYear().toString();
var tomorrow:Date = new Date(da.getFullYear(),(da.getMonth()+1) ,da.getDate());
Current output is like this
if i pass 17th March, 2011 then i got result 17th April, 2011.
if i pass 31st January, 2011 then i got result 3rd March, 2011.