Is there a good Flex (3) date and time picker?

I need a timing for a flexible application, and as far as I can tell, there is no interface component for managing objects Datewith a resolution of less than a day (component DateChooser).

What is a good time for Flex? I prefer Free as in Libre and / or Free, as in the Beer component.

+3
source share
6 answers
+5
source

Yahoo! Astra TimeInput TimeStepper .

http://developer.yahoo.com/flash/astra-flex/timeinput/

http://developer.yahoo.com/flash/astra-flex/timestepper/

, -, SDK Flex 4, Yahoo! Astra.

You can check this link for the version that works with Flex 4. https://github.com/joshtynjala/astra-flex

I think time input will be a good candidate for the native Flex SDK component.

+1
source

Try the following code: It will be useful to enter the format HH: MM 12hr without AM / PM

MXML Code:

<Timepicker maxChars="5" restrict="0-9" />

ActionScript Code:

package
{
import flash.events.KeyboardEvent;

import mx.controls.TextInput;

public class Timepicker extends TextInput
{
    public function Timepicker()
    {
    }

    override protected function keyUpHandler(event:KeyboardEvent):void
    {
        super.keyUpHandler(event);

        if (text.length == 0)
        {
            return;
        }
        var keyDel:Boolean=false;
        if (event.charCode == 8 || event.charCode == 46)
            keyDel=true;
        var numberString:String=text;
        if (keyDel)
            text=numberString;

        if (numberString.length > 0 && !keyDel)
        {
            if (numberString.length == 2 && numberString.indexOf(":") == -1)
            {
                text=numberString;
                textField.appendText(":");
            }
            else if (numberString.length >= 4 && Number(numberString.charAt(3)) > 5)
            {
                text=numberString.substr(0, 3)
            }
            else if (numberString.length == 3 && numberString.charAt(2) != ":")
            {
                if (Number(numberString.charAt(2)) <= 5)
                {
                    var fourthDigit:String=numberString.charAt(2);
                    super.textField.text="";
                    super.textField.appendText(numberString.substring(0, 2) + ":" + fourthDigit);
                }
                else
                {
                    super.textField.text="";
                    super.textField.appendText(numberString.substring(0, 2) + ":");
                }
            }
            textField.setSelection(textField.length, textField.length);

        }
    }

    override protected function keyDownHandler(event:KeyboardEvent):void
    {
        super.keyDownHandler(event);
        var keyDel:Boolean=false;
        if (event.charCode == 8 || event.charCode == 46)
            keyDel=true;

        super.text=text;
        if (super.text.length == 0)
        {
            var inputVal:String=String.fromCharCode(event.charCode);
            if (Number(inputVal) > 1)
            {
                super.textField.appendText("0" + inputVal + ":");
            }
        }
        super.textField.setSelection(super.textField.length, super.textField.length);
    }

}

}

0
source

Source: https://habr.com/ru/post/1717868/


All Articles