-
7 Feb 2011 3:38 AM #1
Date format
Date format
Hi,
I'm trying to build an editorGridPanel, and I'm having some trouble with the date cells.
For some reason, when I define a column to be date formatted, although I define it as 'Y-m-d' it shows a full date with a GMT code... for example: instead of showing 2011-02-04, it will show:
Fri Feb 04 2011 00:00:00 GMT+2000....
Once I tried to change the format from 'date' to 'string', the date looked as I wished.
but than I got into a new problem: if I want the date to be editable as date, I must define him as 'date' in the editor definition. but in that case, after the edit will be fired, the cell format will be 'date' again and not string, and than the cell will once again - show Fri Feb 04 2011 00:00:00 GMT+2000 instead of 2011-02-04....
Am I missing something here? Can anyone help me please?
Thanks,
Nissan.
-
8 Feb 2011 12:25 AM #2
Check the record definition. Config object for date field should look like
Records "dateFormat" config option is used by DataReader to convert date values from string to Date object, while columns "format" config option is used to convert Date objects into string to display inside grid cell.PHP Code:var GridRecordClass = Ext.data.Record.create([
// ...
{name: 'some_date_field', type: Ext.data.Types.DATE, dateFormat: 'Y-m-d'}
// ...
]);
Think less, write more.
Similar Threads
-
Date Format + Date Column on Grid
By smichels in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 22 Jul 2010, 8:25 PM -
[2.??][CLOSED] Date bug d/m/Y Swaps day + month when entering date in format d/m/yyy
By gp28tech in forum Ext 2.x: BugsReplies: 2Last Post: 23 Mar 2009, 12:44 AM -
How to change date format after a date field has been created?
By lensesby in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 3 Mar 2009, 7:11 AM -
date format on grid. Format is not displayed as expected.
By mcrusty in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 26 Jan 2007, 4:05 PM


Reply With Quote