I have a timefield defined in a form panel.
I am making an AJAX call to the IBM i passing back JSON pairs to the front end. The value returning for countDate is 08/26/2013 and countTime is 08:57 AM. Here is how I am populating the fields.
Later when a button click event happens, I want to pass those values back to the IBM i. Here is how I am getting the values of the fields.
countDate now has a value of Mon Aug 26 2013 00:00:00 GMT-0400 (Eastern Daylight Time), countTime is null. It appears to me I am having an issue with the parse function when the countTime field has it's value set. What format do I pass to countTime so the field gets populated correctly?
Code:
xtype : 'fieldcontainer', anchor : '30.25%', height : 22, layout : { align : 'stretch', type : 'hbox' }, fieldLabel : 'Label', hideLabel : true, items : [{ xtype : 'datefield', flex : 1, fieldLabel : 'Count Date', itemId: 'countDate', name: 'countDate', labelAlign : 'right', value: new Date(), labelWidth : 75 }, { xtype : 'timefield', margin : '0 0 0 5', flex : 1, fieldLabel : 'Count Time', itemId: 'countTime', name: 'countTime', value: new Date(), increment: 15, labelAlign : 'right', format : 'g:i A', altFormats : 'g:i A' }]
Code:
this.getInventoryCountHeader().down('#countDate').setValue(data.COUNTDATE); this.getInventoryCountHeader().down('#countTime').setValue(data.COUNTTIME);
Code:
var countDate = this.getInventoryCountHeader().down('#countDate').getValue(); var countTime = this.getInventoryCountHeader().down('#countTime').getValue();
Comment