2017-09-21 18 views
0
{ 
       title: 'End Date', 
       margin: '0 20 0 0', 
       items:{ 
        xtype: 'datepicker', 
        itemId: 'endDate', 
        value: Ext.Date.add(new Date(), Ext.Date.DAY, -1), 
        showToday: false, 
        handler: function(picker, date) { 
         var timeIntervalPanel = this.up('button#timeIntervalPanel'); 
         var startDate = timeIntervalPanel.startDate; 
         timeIntervalPanel.setDates(startDate, date); 
       } 
       } 
      }] 
      }, 
      { 
       xtype: 'container', 
       layout: 'hbox', 
       items: [ 
        { 
         margin: '0 20 0 0', 
         items:{ 
         xtype: 'timefield', 
         name: 'startHourCombo', 
         id: 'startTime', 
         maxWidth: 100, 
         columnWidth: 0.2, 
         minValue: '12:00 AM', 
         maxValue: '11:00 PM', 
         increment: 60, 
         anchor: '100%', 
         value: '12:00 AM' 

         } 
       } 
+0

であるあなたは、日付フィールドの側で時間を表示しますか? datefieldの書式設定を見てください。 http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.field.Date-cfg-format。 – AswathyPrasad

答えて

0

これはあなたが欲しいものですか?

enter image description here

その後コードは

{ 
        xtype : 'container', 
        layout : 'hbox', 
        defaults :{ 
         margin :'10 10 10 10' 
        }, 
        items :[ 
          { 
           xtype: 'datefield',          
           fieldLabel: 'Date', 

          }, 
          { 
           xtype: 'timefield', 
           name: 'startHourCombo', 
           id: 'startTime', 
           maxWidth: 100, 
           columnWidth: 0.2, 
           minValue: '12:00 AM', 
           maxValue: '11:00 PM', 
           increment: 60, 
           anchor: '100%', 
           value: '12:00 AM' 
          } 
          ] 
       } 
+0

日付フィールドと時刻フィールドから選択した値を一緒に追加し、コンポーネントではなく – sandy

+0

を表示したい – sandy

+1

これは非常に関与し、新しい日付ピッカーを作成することになります。おそらくdatepickerコンポーネントを拡張し、新しいピッカーを持つように変更する必要があります。 –

関連する問題