xtype:sencha touch中的timepicker 2.与xtype:datepicker相同

时间:2012-09-26 11:14:30

标签: model-view-controller sencha-touch-2 timepicker

在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',
    }]
}

});`

1 个答案:

答案 0 :(得分:0)


可能这可以帮到你。

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

参考Ext.Date