0

在 Sencha touch 2 MVC 中如何插入 24 小时格式的时间选择器?. 我想要它的形式,但无法实施。`var entryForm = Ext.define("TimeSheet.view.Newentry", { extend: "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',
    }]
}

});`

4

1 回答 1

0


可能这可以帮助你。

G --- 没有前导零的小时的 24 小时格式 --- 0 到 23

参考Ext.Date

于 2012-09-26T13:01:22.293 回答