tags:

views:

677

answers:

2

i,

I have a date renderer issue for a column. when browser language is in english the date is displayed in this format

09/14/2009 09:23 AM

But when i change the browser language to german(displays coreect in english and french) the date is not rendered it displays NAN/NAN/NAN 12:NAN PM

Here is the code..

var dateRenderer = Ext.util.Format.dateRenderer('m/d/Y h:i A');

var colModel = new Ext.grid.ColumnModel([
{ 
     header: xppo.st('SDE_DATE_OCCURRED'), 
     width: 75, 
     sortable: true, 
     dataIndex: 'DateOccurred', 
     renderer: dateRenderer 
}]);

How can i render the date in other languages.Please help me with this issue.

Thanks

A: 

Are you certain that the input date is being parsed correctly for German? The dateRenderer output should be the same -- if it works at all, the language should not matter. Since you are getting NaN it's more likely that something in the input data for German is invalid.

bmoeskau
The data on server side is rendered correctly..German: on the server side thwe date rendered in german is in this format 14.09.2009 10:23:00 and on the client side it displays NAN/NAN/NAN 12:NAN PM For french on the server side the date rendered on server is in this format 14/09/2009 10:23:00 and on client side it displays 14/09/2009 10:23 AM
harsh
var dateRenderer = Ext.util.Format.dateRenderer('m/d/Y h:i A');Date renderer in german is m.d.Y and not m/d/Y Can you please help me how do i display date rendere in german correctly?
harsh
If I dont use any rendere for that column then the data is displayed as 14.09.2009 10:23:00 but when i use date rendere in that column it is displayed as NAN. Can you please help me with this issue.
harsh
A: 

Hello from Germany :D Why dont you use an Ext.grid.DateColumn ? its very simple... simply pass

format: "d.m.Y H:i:s"

to its constructor and everything should be fine :)

Nexum