PDA

View Full Version : crud post different date format



moegal
4 Jun 2011, 4:47 AM
Hi,

I am having an issue with some data being posted via CRUD. I have the following DATE field in my store:



{name: 'startdate', type: 'date', mapping: 'startdate', dateFormat: 'm/d/Y'},


I have the proper formats set from the grid and the form. my grid and forms work properly but the date gets submitted as "startdate":"2011-06-03T00:00:00"

I would prefer "startdate":"06/03/2011"

Any ideas? I did do several searches of the forum, but could not find an answer that works.

Thanks, Marty

skirtle
5 Jun 2011, 4:14 PM
If I've understood correctly, you're using an Ext.data.JsonWriter. The render() method of JsonWriter uses Ext.encode() to generate a string representation of the passed object, which for dates will give you a string in the format you stated. I think you'll need to extend JsonWriter and override render() to get the format you want.

moegal
7 Jun 2011, 3:14 AM
skirtle,

Thanks, I was hoping for a property that I could set.

I appreciate the response.

Marty