IT기술/Flex

flex 9 DateChoser, DateField

dobbby 2008. 11. 20. 11:23
반응형




DateTest.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" color="#FFFFFF">
 <mx:Script>
  <![CDATA[
   import mx.formatters.DateFormatter;
    [Bindable]
    var l1:String = "";
    public function changed():void{
     var dformat:DateFormatter = new DateFormatter();
     dformat.formatString = "YYYY/MM/DD";
     l1 = dformat.format(df1.selectedDate); 
    }
    
  ]]>
 </mx:Script>

 <mx:DateChooser horizontalCenter="0" verticalCenter="0" dayNames='["sun", "mon", "tue", "wed", "thu", "fri", "sat"]'
  monthNames='["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]' color="#000000" height="206" width="331"/>
  
 <mx:DateField dayNames='["sun", "mon", "tue", "wed", "thu", "fri", "sat"]'
  monthNames='["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]'
  formatString="YYYY/MM/DD"  horizontalCenter="0" verticalCenter="131" change="changed();" id="df1"/>
 <mx:Label width="111" height="46" alpha="1.0" text="{l1}" color="#FFFFFF" horizontalCenter="0" verticalCenter="173" fontSize="18"/>
</mx:Application>


반응형