server date format problem - same result
hi. i got similar problem. i send from server date in 2 formats:
1. "Tue Jan 11 18:24:59 GMT+05:30 2007"
rows:[{...,"date_realization":"Tue Jan 11 18:24:59 GMT+05:30 2007",...}]
2. "2007-02-02 00:01:01"
rows:[{...,"date_realization":"2007-02-02 00:01:01",...}]
ad1. it renders ok every time (i dont even need type:'date' in store.reader.fields)
ad2.
if i got no type:'date' in store.reder.fields it renders as : NaN/NaN/NaN
but if i have type:'date', result depends on rendering function:
- if i use new Ext.util.Format.dateRenderer('d/m/Y') - i got nothing (blank) in the grid cell.
- if i use function(v){return new Date(v).format('d/m/Y')}, - i got always 01/01/1970 (thats not my date!)
What is going on? How does server data should look like?
I want to send date in ISO like: yyyy-MM-dd hh:mm:ss
ADNOTATION
i also managed to render this server format:
rows:[{....,"date_realization":1260763250000,....}] - no quots
by using function(v){return new Date(v).format('d/m/Y')} and no type:'date' in store.reader.field
but i really want to do it right with iso format. yyy-mm-dd hh:mm: ss
ANSWER
,type:'date',dateFormat:'c'...
DateField shows time and ate when click on roweditor update button
Hi,
I am facing different problem, which I am unable to configure. I resoved my problem of NaNNaNNaN by rendering datefield as editor : new fm.DateField({
format:'d/m/Y',
renderer :Ext.util.Format.dateRenderer('d/m/Y')
})
But when I select date from datefield and hit update button of roweditor, I get date format as for eg : Mon Apr 02 2012 00:00:00 GMT+0100 (GMT daylight Time). I want to appear the date as 02-04-2011.
Please let me know how to do settings.
What if i have got two dates : end date and start date into one cell ????
Quote:
Originally Posted by
mystix
re:
- stick with ISO-8601 date format.
there's no "render" config.
see http://extjs.com/docs/?class=Ext.gri...ember=renderer
your ColumnModel definition should read
Code:
{
header: 'Date',
dataIndex: 'Date',
renderer: Ext.util.Format.dateRenderer(Date.patterns.ShortDate)
}
p.s. are you sure
Date.patterns.ShortDate is defined?
be sure to check that.
What if i have got two dates : end date and start date into one cell ????