<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
private var dayNames:Array = ["A", "B", "C", "D", "E", "F", "G"];
private var monthNames:Array = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];
private function formatDate(date:Date):String
{
if (!date)
{
return "";
}
var monthDay:String = String(date.getDate());
var monthName:String = monthNames[date.getMonth()];
var year:String = String(date.getFullYear());
return monthDay + " " + monthName + " " + year;
}
private function initDate():void
{
df.dayNames = dayNames;
df.monthNames = monthNames;
}
]]>
</mx:Script>
<mx:DateField id="df" creationComplete="initDate()" labelFunction="formatDate" parseFunction="null"/>
</mx:Application>
|