javascript - Sencha 中的 Ext.Date.format()

标签 javascript extjs sencha-touch-2

我想获取像2017-04-20 00:00:00这样的日期格式

目前我的代码是

this.ToDatePicker = Ext.create('Ext.form.field.Text', {
        xtype: 'textfield',
        name: 'name',
        labelAlign: 'top',
        fieldLabel: 'Date Time',
        value: Ext.Date.format(new Date(), "d-m-Y h:iA"),
        listeners: {
            scope: this,
            afterrender: function (c) {
                c.getEl().on('click', function (e) {
                    console.log(e.target)
                    NewCssCal_DisableAfterToday(Ext.get(e.target).dom.id, 'ddmmyyyy', 'dropdown', true, 12)
                });
            }
        }
    });

需要更新Ext.Date.format(new Date(), "d-m-Y h:iA") 根据需要获取该日期格式。你有什么想法吗?

最佳答案

根据 Ext.Date 的文档,你可以使用:

Ext.Date.format(new Date(), "Y-m-d h:i:s")

关于javascript - Sencha 中的 Ext.Date.format(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43512173/

相关文章:

javascript - mouseover 和 mouseout 事件可以不匹配吗?

javascript - 在某些 slider 值处更新文本

extjs - 在 sencha 列表项点击上显示隐藏 div

extjs - 如何为 CRUD Couch DB 设置 EXTJS4 商店?

javascript - Sencha Touch 2 安卓性能

javascript - 如何拆分 url 以获取 JavaScript 中的 url 路径

javascript - cufon 不工作

extjs - 如何从 View 中获取应用程序?

javascript - 如何将 Google Endpoints 与 Sencha Touch 结合使用?

javascript - 如何将 sencha 按钮添加到 sencha 列表