Extjs日期列格式 [英] Extjs date column format
本文介绍了Extjs日期列格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
2013-02-05
,但是当关闭编辑时,它显示类似于 Sat Jul 12 2014 00:00:00 GMT + 0300(FLE标准时间)
我的代码:
{
xtype:'datecolumn',
dataIndex:'depreciationStartPeriod',
header:'折旧开始期',
sortable:
id:'depreciationStartPeriod',
width:134,
编辑器:{
xtype:'datefield',
格式:'Ymd H: i:s'
}
},
存储字段:
{
name:'depreciationStartPeriod',
type:'String',
dateFormat:'c '
},
原因可能是什么?
更新
在存储中,由于某种原因,它也以错误的格式保存,这就是为什么它以这种格式显示,但是我现在不这样做的原因。
解决方案
{
xtype:'datecolumn',
dataIndex :'depreciationStartPeriod',
header:'折旧开始期',
可排序:true,
id:'depreciationStartPeriod',
width:134,
格式:' Ymd H:i:s',// <-------这样
编辑器:{
xtype:'datefield',
格式:'Ymd H:i: s',
submitFormat:'c'//< --------------这样
}
},
i have date column with datefield editor. The problem is that while im editing column it displays the normal value for example 2013-02-05
, but when close editing it displays something like Sat Jul 12 2014 00:00:00 GMT+0300 (FLE Standard Time)
My code:
{
xtype : 'datecolumn',
dataIndex : 'depreciationStartPeriod',
header : 'Depreciation start period',
sortable : true,
id : 'depreciationStartPeriod',
width : 134,
editor : {
xtype : 'datefield',
format: 'Y-m-d H:i:s'
}
},
store field:
{
name : 'depreciationStartPeriod',
type : 'String',
dateFormat: 'c'
},
what the reasons could be?
UPDATE
in store it is also saved with wrong format for some reason, that's why it is being displayed in such format, but i don`t now the reason of that.
解决方案
{
xtype : 'datecolumn',
dataIndex : 'depreciationStartPeriod',
header : 'Depreciation start period',
sortable : true,
id : 'depreciationStartPeriod',
width : 134,
format: 'Y-m-d H:i:s', // <------- this way
editor : {
xtype : 'datefield',
format: 'Y-m-d H:i:s',
submitFormat: 'c' // <-------------- this way
}
},
这篇关于Extjs日期列格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文