Search code examples
apache-flexairtimer

Flex 4.6 time picker component?


Is there any component is used as time picker in Adobe flex4.6 or AIR.I need to get time as input. thanks in advance.


Solution

  • You can just slap two numeric steppers together.

    <s:NumericStepper id="dateHour" minimum="0" maximum="23" value="{_someDate.getHours()}" />
    <s:NumericStepper id="dateMinute" minimum="0" maximum="59" valueFormatFunction="{leadingZero}" value="{_someDate.getMinutes()}"/>
    

    and the leading zero function,

    public static function leadingZero(value:Number):String
    {
        if(value < 10){
            return "0" + value;
        }
        return value.toString();    
    }