I needed to work out a date range according to the date 3weeks away from the current date.
After a bit of thinking, I found that it’s actually quite easy to achieve.
dateDay = theDate.getDate();
dateMonth = theDate.getMonth();
dateYear = theDate.getFullYear();
var theDate2:Date = new Date(dateYear,dateMonth,dateDay);
theDate2.setDate(theDate2.getDate() + 21);
dateDay2 = theDate2.getDate();
dateMonth2 = theDate2.getMonth();
dateYear2 = theDate2.getFullYear();</span>
The above code gets the current date and adds 21days/3weeks to it.
Remember that if you use getMonth to output the final month number, you will want to add 1 to it as it starts at 0;
So you would do it like this: