extjstimefield

ExtJS timefield 24 hour format picker


I'm using ExtJS 7.3.1 (modern) and I have a problem with the timefield picker. I can't find a solution to let the user choose directly in the 24hour format without switch between AM and PM option ... is it possible? In the visualization no problem, because there is the format property ('H:i').


Solution

  • For this, you would have to set the meridiem config of the picker to false:

    {
        xtype: 'timefield',
        label: 'Birthday',
        format: 'H:i',
        picker: {
            meridiem: false
        }
    }
    

    enter image description here

    Also note, there is alignPMInside config (also on the picker), that when set to true, will align the hours in two circles:

    {
        xtype: 'timefield',
        label: 'Birthday',
        format: 'H:i',
        picker: {
            meridiem: false,
            alignPMInside: true
        }
    }
    

    enter image description here