PDA

View Full Version : DateFormat Hell - I beg for a little help



incanus
29 Apr 2011, 8:32 AM
Hi everyone, I've a troble with a date field in a store.
The dates that come are in format "29/04/2011 12:35", for instance. And i have my field configured with type:'date', dateFormat:'d/m/Y H:i'.

I've tried with that dateFormat and without it, and with the date i've written upwards, it works well, BUT.... the data i got from my system, wich time is 00:00 doesn't come like that (00:00) but comes like "0:00". That unique '0' makes the store to don't understand the dates, and get "undefined" values in my column.

Is there a way to write two dateformats, or a wildcard, o something that could make this works?
After several hous the only workaround i thought i have, is to make two columns, and in the load event, do a foreach and parse for myself from the source string and create a new date column.

Thanx in advance, and sorry about my english,

Regards

friend
29 Apr 2011, 9:37 AM
It sounds like a problem on the server side, when the data is being serialized to JSON.

If you inspect the JSON response with Firefox/Firebug, are the datetime stamps missing zeros there? If so, then it's an issue you must cure on the server side...

incanus
3 May 2011, 1:17 AM
Yes, the data in the JSON response is like this:

"29/04/2011 16:34", <-- when time is other than 00:00

"16/04/2011 0:00", <-- and my friend.....

Then, there isn't any way to handle it? I think that the fastest way will be to do a "for" on the store, and modify the field by hand....

EDIT: i got it!! in deed, it was the server configuration. All the hours with one digit came with only one, and now they come with 2. thanx!