user15981728
user15981728

Reputation: 3

EXTJS 7 Editable Grid, Select date in datefield, wrong dateformat in column

I have the problem with a editable grid. in the grid there is a datecolumn. if i change the value with the datefield to 23.12.2022 for example and save the row. the server saves it correct but in the gridcolumn i get the dateformat "fri dec 23 2022 00:00:00 GMT+0100". where is my problem? i cant find any solution that works. i tried it with in the data model i tried some in the datefield like submitformat. i always got the gmt string and not the well formated date d.m.Y in the columnfield. has anyone an idea?

I explained it wrong! I have an editible grid with an column (the column is just a string field because it can contain different values like date,number) with different editfields. when the datefield is active and i edit the value of this column with a datefield i always geht the gmt date string. its not possible for me to format this datestring

Upvotes: 0

Views: 298

Answers (1)

Arthur
Arthur

Reputation: 413

In your datecolumn, specify the format, like:

columns: [
 {
  text: 'Date',
  dataIndex: 'date',
  xtype: 'datecolumn',
  format: 'd.m.Y'  //This is the format that you want
 }, 
 // other grid columns
]

You can check more date formats at: https://docs.sencha.com/extjs/7.0.0/modern/Ext.Date.html

Upvotes: 1

Related Questions