Flex中通过DateField等接收年月日时分秒的输入

 

使用DateField接收年月日,NumericStepper接收时分秒,具体实现:
     <mx:Grid width="100%" >
      <mx:GridRow>
       <mx:GridItem horizontalAlign="left">
        <mx:DateField id="upTime" selectedDate="{new Date()}" formatString="YYYY-MM-DD" enabled="true" showToday="true" textAlign="center" yearNavigationEnabled="true"/>
        <mx:NumericStepper id="upHour" maxChars="2" minimum="0" maximum="23" stepSize="1" textAlign="center" width="40"/>
        <mx:Label text="时" textAlign="center" width="15"/>
        <mx:NumericStepper id="upMinute" maxChars="2" minimum="0" maximum="59" stepSize="1" textAlign="center" width="40"/>
        <mx:Label text="分" textAlign="right" width="15"/>
        <mx:NumericStepper id="upSecond" maxChars="2" minimum="0" maximum="59" stepSize="1" textAlign="center" width="40"/>
        <mx:Label text="秒" textAlign="center" width="15"/>
       </mx:GridItem>
      </mx:GridRow>
     </mx:Grid>

通过selectedDate="{new Date()}",让DateField一开始按照格式formatString="YYYY-MM-DD"显示当前时间,而text="{newDate()}"虽然也能显示当前时间,但不能显示设定的格式……

 
 
 
http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece7631045952458438014668cc7150884c013c5234c413037bee43a634a579392613156e91a07b4ed3575300326b19cc39c0f80fbc4277bd6707e671cf71741954eb8ca36719a77ce0cfeae69f0cb8325e3adc5a3ae4324cc44040a9780fa4d7712dd1ffa0345e5&p=9078c64ad1800af308e297781e5f&user=baidu&fm=sc&query=flex+datefield%CA%B1%BC%E4%BC%E4%B8%F4&qid=920f1a6209e9c07c&p1=4

你可能感兴趣的:(Flex中通过DateField等接收年月日时分秒的输入)