|
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();">
<mx:Script> <![CDATA[ import mx.controls.DateField;
private const MASK:String = "DD/MM/YYYY";
private function init():void { var today:Date = new Date(); var halloween:String = "31/10/2007";
var todayString:String = DateField.dateToString(today, "DD/MM/YYYY"); todayLabel.text = todayString;
var halloweenDate:Date = DateField.stringToDate(halloween, "DD/MM/YYYY"); halloweenLabel.text = halloweenDate.toDateString(); } ]]> </mx:Script>
<mx:Form> <mx:FormItem label="today ({MASK}):"> <mx:Label id="todayLabel" /> </mx:FormItem> <mx:FormItem label="Halloween:"> <mx:Label id="halloweenLabel" /> </mx:FormItem> </mx:Form>
</mx:Application>