Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6160 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    May 2010
    Location
    Wiesbaden
    Posts
    17
    Vote Rating
    0
    CSC-Germany is on a distinguished road

      0  

    Default Ext.form.field.Time does not initialize value correctly

    Ext.form.field.Time does not initialize value correctly


    Ext version tested:
    • Ext 4.1
    Browser versions tested against:
    • all
    DOCTYPE tested against:
    • n/a
    Description:
    • Ext.form.fieldTime does not initialize a non-empty value correctly, so that it will always be marked as dirty, allthough it might not have been changed.
    Steps to reproduce the problem:
    • see Test case
    The result that was expected:
    • see Test case
    The result that occurs instead:
    • see Test case
    Test Case:

    Code:
    var f=Ext.create('Ext.form.Panel', {
        title: 'Time Card',
        width: 300,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'timefield',
            name: 'in',
            fieldLabel: 'Time In',
            minValue: '6:00 AM',
            maxValue: '8:00 PM',
            increment: 30,
            anchor: '100%',
            value:'11:00 AM'
        }]
    });
    
    console.log(f.items.first().isDirty())


    HELPFUL INFORMATION


    Screenshot or Video:
    • none
    Debugging already done:
    • yes
    Possible fix:
    A possible fix is borrowed from the datefield, using the initValue function for the timefield too:

    Code:
    Ext.override(Ext.form.field.Time, {
            initValue : function() {
                var me = this, value = me.value;
    
    
                // If a String value was supplied, try to convert it to a proper Date
                if (Ext.isString(value)) {
                    me.value = me.rawToValue(value);
                }
    
    
                me.callParent();
            }
        });
    Additional CSS used:
    • n/a
    Operating System:
    • all

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,010
    Vote Rating
    460
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thank you for the report. It should behave as setRawValue

    Regards,
    Scott.

Thread Participants: 1