Mega Code Archive

 
Categories / Flex / Data Model
 

Declare a DateFormatter with an MMDDYYYY date format

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">   <mx:DateFormatter id="dateFormatter" formatString="month: MM, day: DD, year: YYYY" />   <mx:Label text="Enter date (mm/dd/yyyy):" />   <mx:TextInput id="dob" text="" />   <mx:Label text="Formatted date: " />   <mx:TextInput id="formattedDate" text="" editable="false" />   <mx:Button label="Format Input" click="formattedDate.text=dateFormatter.format(dob.text);" /> </mx:Application>