PDA

View Full Version : datefield format question



Bleak
1 Dec 2010, 5:20 AM
I don't know why, but dates always give me problems. I have a form field defined as



{
xtype : 'datefield',
format : 'Y-m-d',
fieldLabel : 'Actual Start Date',
anchor : '-20',
name : 'actualStartDate'

}
The Data Mapping in the store is defined as follows;



{
name :'actualStartDate',
type : 'date',
dateFormat: 'Y-m-d'
}
However, the form always submits it as "actualStartDate":"2010-12-01T00:00:00" which doesn't work when my backend attempts to parse it as a date.

Am I missing something? I've defined the store format, as well as the form format.

Any help would be appreciated.

Bleak
1 Dec 2010, 5:24 AM
Ok, I just noticed that if I submit the form containing this datefield using form.getForm().submit(...); it works properly. The difference here, is I am actually taking the forms values, and updating an associated record in a data store and the store is submitting the record for updating on the backend.

Shouldn't the store still submit the values properly, based on the formats defined on the form field?

Bleak
1 Dec 2010, 7:30 AM
This is killing me. It seems to me, that the store ALWAYS submits the value in the following format "2010-12-15T00:00:00" regardless of the dateFormat I set on the record definition.

I've tried numerous different dateFormats on the record definition, but it always sends the data to the back-end using the same format, which seems to be the browsers default format.

msinn
8 Dec 2010, 5:15 AM
This is killing me. It seems to me, that the store ALWAYS submits the value in the following format "2010-12-15T00:00:00" regardless of the dateFormat I set on the record definition.

I've tried numerous different dateFormats on the record definition, but it always sends the data to the back-end using the same format, which seems to be the browsers default format.


http://www.sencha.com/forum/showthread.php?117105-SOLVED-CRUD-JsonStore-JsonWriter-date-format