最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - EXTJS Date Field in Grid not appearingformatting - Stack Overflow

programmeradmin0浏览0评论

In my grid data store, I have a date field which contains data ing in from the database as 20/12/2010 13:01:53.180.

No matter what type of formatting I try, it either does not display or outputs similar to Thu 26 May 2011 00:00:00 GMT+0100 (GMT Daylight Time).

What I ultimately what is output similar to 26 May 2011.

I have tried the following

Field: [{
{name:'viewedDt', type: 'date', dateFormat: 'd-F-Y'}}

Columns: [{
 ,{xtype: 'datecolumn', id:'lastViewedDate', header: "Last Viewed Date", width: 130, sortable: true, format: 'Y-m-d H:i:s', dataIndex: 'viewedDt', align: 'center'} },


,{id:'lastViewedDate', header: "Last Viewed Date", width: 130, sortable: true, renderer: Ext.util.Format.dateRenderer('d/F/Y'), dataIndex: 'viewedDt', align: 'center'}

Any tips on how to resolve this?

In my grid data store, I have a date field which contains data ing in from the database as 20/12/2010 13:01:53.180.

No matter what type of formatting I try, it either does not display or outputs similar to Thu 26 May 2011 00:00:00 GMT+0100 (GMT Daylight Time).

What I ultimately what is output similar to 26 May 2011.

I have tried the following

Field: [{
{name:'viewedDt', type: 'date', dateFormat: 'd-F-Y'}}

Columns: [{
 ,{xtype: 'datecolumn', id:'lastViewedDate', header: "Last Viewed Date", width: 130, sortable: true, format: 'Y-m-d H:i:s', dataIndex: 'viewedDt', align: 'center'} },


,{id:'lastViewedDate', header: "Last Viewed Date", width: 130, sortable: true, renderer: Ext.util.Format.dateRenderer('d/F/Y'), dataIndex: 'viewedDt', align: 'center'}

Any tips on how to resolve this?

Share Improve this question asked Sep 1, 2011 at 10:25 pm13pm13 7457 gold badges23 silver badges37 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Field should have a format string matching the format in which date is received from database (20/12/2010 13:01:53.180 -> d/m/Y H:i:s.u) Column on the other hand should have format according to how you want to display the date (26 May 2011 -> d F Y).

发布评论

评论列表(0)

  1. 暂无评论