Either I've missed something, or there is no DateAdd() function built into the basic Flex installation. Well that simply won't do, I need to be able to add dates! There's no DateDiff(), either. I must be missing something.
var newDate:Date;
switch(addUnit){
case 'y':
newDate = new Date(origDate.fullYear+addVal, origDate.month, origDate.date);
break;
case 'm':
newDate = new Date(origDate.fullYear, origDate.month+addVal, origDate.date);
break;
case 'd':
newDate = new Date(origDate.fullYear, origDate.month, origDate.date+addVal);
break;
}
return newDate;
}


There are no comments for this entry.
[Add Comment]