我想获取像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/