javascript - Extjs 日期列格式

标签 javascript date extjs datepicker date-format

我有带日期字段编辑器的日期列。问题是,当我编辑列时,它显示正常值,例如 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/

相关文章:

javascript - 如何在javascript中制作特殊格式的日期和时间

JavaScript山区夏令时奇怪的行为

javascript - 使用浏览器后退按钮的 ExtJS 应用程序导航

javascript - 动画的初始滞后

javascript - 用JS创建带有onMouseOver效果的DIV

date - hive cast string to date in 'dd/MMM/yyyy' format order by and group by issue

apache - 504 Gateway Time-out 服务器未及时响应。如何修复它?

javascript - 使用javascript将字符串操作成dom元素

javascript - <v-data-table> 内的模板 v-slot 在 vue 2.0.15 中不起作用

javascript - 如何将图像设置在其他图像下?