1. #1
    Ext User
    Join Date
    Jul 2007
    Posts
    26
    Vote Rating
    0
    marco.braga is on a distinguished road

      0  

    Default Time field

    Time field


    Hello,

    I need to allow the user to insert a date and time in a form. DatePicker is perfect for this, but I need the time widget. Can you suggest how to do it?
    The simpler way is to use a text field, but I'd like to have something fancier.. Perhaps to allow the user to enter time with or without seconds, or some graphic knob to pull..
    Do you think it would be better to use 3 numeric fields instead of a text one? Or perhaps a combo box for hour, minutes and seconds? Do you have a piece of code you'd like to share?

    Thanks a lot!

  2. #2
    Sencha User fancing's Avatar
    Join Date
    Aug 2007
    Posts
    25
    Vote Rating
    0
    fancing is on a distinguished road

      0  

    Default


    Yes, is there any samples on Time selecting field, similar with DateField?
    Thanks!

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    There is a simple TimePicker in 2.0 (in SVN). It's a combo field that allows typing directly or choosing from the list. Unfortunately there's nothing in 1.x for this.

  4. #4
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    Location
    "A Land Down Under"
    Posts
    618
    Vote Rating
    1
    catacaustic is on a distinguished road

      0  

    Default


    As far as version 1 goes, I think the simplest solution to this would be a standard TextField element with the config options set like
    Code:
    emptyText: "HH:MM:SS", 
    maskRe: "^[0-9]{1,2}:[0-9]{2}(:[0-9]{2})?$"
    (please forgive the regular expression if it isn't quite right... I haven't checked it, but it gives you a good idea of what to do)

    If you have those set, you can let the users know what goes in there and also keep them from entering anything that shouldn't be there in the first place with the validation that's built into the Ext forms.

  5. #5
    Ext User
    Join Date
    Jul 2007
    Posts
    26
    Vote Rating
    0
    marco.braga is on a distinguished road

      0  

    Default


    Is version 2.0 already usable or it is still very buggy?

    At the moment I've decided to go for a text field. This is my VType:

    Code:
    Ext.form.VTypes["timeVal"] = /^(0{0,1}[0-9]:[0-5][0-9]|1[0-9]:[0-5][0-9]|2[0-3]:[0-5][0-9])(:[0-5][0-9])?$/;
    
    Ext.form.VTypes["time"]=function(v){
     return Ext.form.VTypes["timeVal"].test(v);
    }
    Ext.form.VTypes["timeText"]="Insert a valid time in the format HH:MM or HH:MM:SS";
    Ext.form.VTypes["timeMask"]=/[:0-9]/;
    I'd like to limit the numer of characters that can be entered in the TextField, I've used maxLength but it is not exactly what I wanted, since the user can still enter more characters and they are checked as validation. Instead I'd like to limit the number of characters when typed. How do I do it?

    Thanks!

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."