我有带日期字段编辑器的日期列。问题是,当我编辑列时,它显示正常值,例如 2013-02-05
,但是当关闭编辑时,它显示类似 Sat Jul 12 2014 00:00:00 GMT+ 0300(FLE 标准时间)
我的代码:
{
xtype : 'datecolumn',
dataIndex : 'depreciationStartPeriod',
header : 'Depreciation start period',
sortable : true,
id : 'depreciationStartPeriod',
width : 134,
editor : {
xtype : 'datefield',
format: 'Y-m-d H:i:s'
}
}
存储字段:
{
name : 'depreciationStartPeriod',
type : 'String',
dateFormat: 'c'
}
可能是什么原因?
更新
在商店里,由于某种原因,它也以错误的格式保存,这就是为什么它以这种格式显示,但我现在不知道原因。
最佳答案
{
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
}
}
关于javascript - Extjs 日期列格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18584530/