PDA

View Full Version : Date column in grid doesn't work right



pieter333
18 Mar 2009, 6:46 AM
Hi,

The date column of my grid doesn't work right. Normally I use d-m-Y or Y-m-d and that works great. But now I have a grid where I want W-Y (week number - year).

Part of my Grid:




Part of the data store:

{name: 'Cell3', mapping: 'cell:nth(3)', type: 'date', dateFormat: 'W-Y'}


Part of the column model:

{
id: 'Cell3',
header: 'Datum',
dataIndex: 'Cell3',
width: 90,
sortable: true,
type: 'date',
renderer: Ext.util.Format.dateRenderer('W-Y')
}
My XML collection:



<rows>
<row id="1"><cell>146355</cell><cell>1453.5000</cell><cell>06-2009</cell></row>
<row id="2"><cell>146555</cell><cell>143.5000</cell><cell>11-2009</cell></row>
<row id="3"><cell>145646</cell><cell>237.7000</cell><cell>06-2008</cell></row>
</rows> Rows id 1 and 2 are displayed as 12-2009 and row id 3 is displayed as 12-2008. So the year works okay but the month is always 12.

What am I doing wrong??

Thanks alot in advance!

Pieter