1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
    antresoldo is on a distinguished road

      0  

    Default maxValue of Timefield less then minValue?

    Hello!
    I have the following code:
    Code:
    header: 'title',
    dataIndex: 'Time',
    field: {
               xtype: 'timefield',
               allowBlank: false,
               format: 'H:i',
               minValue:'9:00 AM',
               maxValue:'24:00 PM'
            },
                width: 100,
                renderer: new Ext.util.Format.timefieldRenderer('H:i')
    How can I make maxValue = 2:00 AM to choose the time from 9:00 AM to 2:00 AM?
    Thanks.

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,334
    Vote Rating
    87
    sword-it is just really nice sword-it is just really nice sword-it is just really nice sword-it is just really nice

      0  

    Default

    Hi!

    i guess, you may not specify lesser value in maxValue.

    try This, it will helps you:-

    Code:
    {
         xtype: 'timefield',
         fieldLabel: 'Time In',
         format: 'H:i',
         minValue: '02:00',
         maxValue: '09:00',
         increment: 30,
         anchor: '100%'
    }
    Output:-
    timefield.png

    also, If you need 'AM' in your timefield, you may use following:-
    Code:
    {
            xtype: 'timefield',
            fieldLabel: 'Time In',
            minValue: '2:00 AM',
            maxValue: '9:00 AM',
            increment: 30,
            anchor: '100%'
        }
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
    antresoldo is on a distinguished road

      0  

    Default

    Thanks, but I need the following range: 9:00, 10:00, 11:00, 12:00, 13:00, ....22:00, 23:00, 24:00(or 00:00), 01:00, 02:00.. Is it really impossible?

    Does anyone know?

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,251
    Vote Rating
    485
    scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute scottmartin has a reputation beyond repute

      0  

    Default

    By Default 2AM < 9AM .. as it is the next day if you go past midnight. You may be able to override the population of the list.

    The alternative could be to just create your own combo and populate it as needed.

    Scott.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
    antresoldo is on a distinguished road

      0  

    Default

    Yeah! Simply the best, in this case. Thank you!