在Sencha touch 2 MVC中,如何插入24小时格式的时间选择器?我希望它以一种形式,但无法实现。‘`var = Ext.define("TimeSheet.view.Newentry",{TimeSheet.view.Newentry:"Ext.TabPanel",要求:"Ext.XTemplate“、"Ext.field.DatePicker”、"Ext.field.Select“、"Ext.TitleBar”、"Ext.DateExtras“、xtype:'newentryview',
config: {
//id: 'newEntry',
autodestroy: true,
fullscreen: true,
scrollable: true,
cardSwitchAnimation: 'cube',
tabBar: {
docked: 'top',
layout: {
pack: 'center'
}
},
defaults: {
styleHtmlContent: true
},
items: [{
xtype: 'formpanel',
name: 'entryForm',
//id: 'entry',
style: 'border: none; font: 22px Arial black',
title: 'Add Entry',
fullscreen: true,
iconMask: true,
iconCls: 'info',
items: [{
xtype: 'fieldset',
name: 'fieldSet',
autoComplete: true,
scrollable: false,
cls: 'add',
items: [{
xtype: 'textfield',
name: 'client',
placeHolder: 'Client name'
},{
xtype: 'selectfield',
name: 'project',
placeHolder: 'Project',
options: [
{text: 'First Option', value: 'first'},
{text: 'Second Option', value: 'second'},
{text: 'Third Option', value: 'third'}
]
},{
xtype: 'textfield',
name: 'task',
placeHolder: 'Task'
},{
xtype: 'datepickerfield',
name: 'date',
value: new Date()
},{
xtype: 'datepickerfield',
name: 'time',
value: new Date(),
//HERE I WANT THE TIME PICKER FIELD IN 24 HR FORMAT..
},{
xtype: 'textareafield',
name: 'notes',
ui: 'textarea',
maxRows: 5,
maxWidth: '100%',
placeHolder: 'Add notes here...'
},{
xtype: 'panel',
name: 'btnpanel',
height: '51px',
width: '100%',
layout: {
type: 'hbox'
},
items: [{
xtype: 'button',
cls: 'btnreset',
text: 'Reset',
style: 'font-size: 14px',
//ui: 'confirm',
height: "35px",
width: '40%',
event: 'tap',
handler: function() {
console.log("reset");
}
},{
xtype: 'spacer'
},{
xtype: 'button',
//id: 'submit',
cls: 'btnsubmit',
text: 'Submit',
style: 'font-size: 14px',
//ui: 'confirm',
height: "35px",
width: '40%',
//go3: 'submitview'
event: 'tap',
handler: function() {
console.log("Submitted");
}
}]
}]
}]
},{
xtype: 'panel',
style: 'border: none; font: 22px Arial black',
title: 'Panel 2',
fullscreen: true,
html: 'Page 2',
}]
});
发布于 2012-09-26 13:01:22
也许这能帮到你。
G --24小时格式,没有前导零--0到23
参考Ext.Date
https://stackoverflow.com/questions/12600447
复制相似问题