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

In my grid data store, I have a date field which contains data ing in from the database as 20122010 1

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).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745180822a4615410.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信