Formatting the SelectedDate in DateChooser
Posted on 31. Mar, 2010 by Sachin in ActionScript 3.0, Adobe Flex
I was suddenly struck up with this DateChooser as my the date object doesn’t recognize the dash as a valid separator.
var date:Date = new Date("2009/12/30");
myDateChooser.selectedDate = date;
The above one works, but if you take the below one it does not work.
var date:Date = new Date(“2009-12-30″);
myDateChooser.selectedDate = date;
The solution for this is DateFormatter.
var DateStr:String = dateFormatter.format(“2009-12-30″);
DateChooser.selectedDate = new Date(DateStr);<mx:DateFormatter id=”dateFormatter” formatString=”MMM D, YYYY”/>
<mx:DateChooser showToday=”false” id=”DateChooser” x=”130″ y=”55″ width=”159″></mx:DateChooser>
This will solve your problem. Have a nice day.

nursing schools
May 12th, 2010
Pretty nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!