Roo/bootstrap/TimeField.js
[roojs1] / Roo / bootstrap / TimeField.js
1 /*
2  * - LGPL
3  *
4  * TimeField
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.TimeField
10  * @extends Roo.bootstrap.Input
11  * Bootstrap DateField class
12  * 
13  * 
14  * @constructor
15  * Create a new TimeField
16  * @param {Object} config The config object
17  */
18
19 Roo.bootstrap.TimeField = function(config){
20     Roo.bootstrap.TimeField.superclass.constructor.call(this, config);
21 };
22
23 Roo.extend(Roo.bootstrap.TimeField, Roo.bootstrap.Input,  {
24     
25     /**
26      * @cfg {String} format
27      * The default time format string which can be overriden for localization support.  The format must be
28      * valid according to {@link Date#parseDate} (defaults to 'H:i').
29      */
30     format : "H:i",
31     
32     
33     UTCDate: function()
34     {
35         return new Date(Date.UTC.apply(Date, arguments));
36     },
37     
38     UTCTime: function()
39     {
40         return new Date(Date.UTC.apply(Date, arguments));
41     },
42     
43     UTCToday: function()
44     {
45         var today = new Date();
46         return this.UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate());
47     },
48     
49     UTCTodayTime: function()
50     {
51         var today = new Date();
52         return this.UTCTime(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), today.getUTCHours(), today.getUTCMinutes());
53     },
54     
55     getDate: function() {
56             var d = this.getUTCDate();
57             return new Date(d.getTime() + (d.getTimezoneOffset()*60000));
58     },
59     
60     getUTCDate: function() {
61             return this.date;
62     },
63     
64     setDate: function(d) {
65             this.setUTCDate(new Date(d.getTime() - (d.getTimezoneOffset()*60000)));
66     },
67     
68     setUTCDate: function(d) {
69             this.date = d;
70             this.setValue(this.formatDate(this.date));
71     },
72         
73     onRender: function(ct, position)
74     {
75         
76         Roo.bootstrap.TimeField.superclass.onRender.call(this, ct, position);
77 //        
78 //        this.language = this.language || 'en';
79 //        this.language = this.language in Roo.bootstrap.DateField.dates ? this.language : this.language.split('-')[0];
80 //        this.language = this.language in Roo.bootstrap.DateField.dates ? this.language : "en";
81 //        
82 //        this.isRTL = Roo.bootstrap.DateField.dates[this.language].rtl || false;
83 //        this.format = this.format || 'm/d/y';
84 //        this.isInline = false;
85 //        this.isInput = true;
86 //        this.component = this.el.select('.add-on', true).first() || false;
87 //        this.component = (this.component && this.component.length === 0) ? false : this.component;
88 //        this.hasInput = this.component && this.inputEL().length;
89         
90 //        if (typeof(this.minViewMode === 'string')) {
91 //            switch (this.minViewMode) {
92 //                case 'months':
93 //                    this.minViewMode = 2;
94 //                    break;
95 //                case 'years':
96 //                    this.minViewMode = 3;
97 //                    break;
98 //                case 'day':
99 //                    this.minViewMode = 1;
100 //                    break;
101 //                default:
102 //                    this.minViewMode = 0;
103 //                    break;
104 //            }
105 //        }
106         
107 //        if (typeof(this.viewMode === 'string')) {
108 //            switch (this.viewMode) {
109 //                case 'months':
110 //                    this.viewMode = 2;
111 //                    break;
112 //                case 'years':
113 //                    this.viewMode = 2;
114 //                    break;
115 //                case 'day':
116 //                    this.viewMode = 1;
117 //                    break;
118 //                default:
119 //                    this.viewMode = 0;
120 //                    break;
121 //            }
122 //        }
123                 
124         this.el.select('>.input-group', true).first().createChild(Roo.bootstrap.TimeField.template);
125         
126         this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
127         
128         this.pop = this.picker().select('>.datepicker-time',true).first();
129         this.pop.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block' 
130         
131         this.picker().on('mousedown', this.onMousedown, this);
132         this.picker().on('click', this.onClick, this);
133         
134         this.picker().addClass('datepicker-dropdown');
135         
136 //        this.startViewMode = this.viewMode;
137         
138 //        this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
139         
140 //        this.setStartDate(this.startDate);
141 //        this.setEndDate(this.endDate);
142         
143 //        this.setDaysOfWeekDisabled(this.daysOfWeekDisabled);
144         
145 //        this.fillDow();
146 //        this.fillMonths();
147         this.fillTime();
148         this.update();
149 //        this.showMode();
150         
151 //        if(this.showTime){
152             
153 //            var dayFoot = this.picker().select('>.datepicker-days tfoot th', true).first();
154 //            var timeFoot = this.picker().select('>.datepicker-time tfoot th', true).first();
155 //
156 //            var dayFootIcon = this.picker().select('>.datepicker-days tfoot span.picker-switch-icon', true).first();
157 //            var timeFootIcon = this.picker().select('>.datepicker-time tfoot span.picker-switch-icon', true).first();
158 //            
159 //            timeFoot.addClass('switch-calendar');
160 //            dayFoot.addClass('switch-time');
161 //            
162 //            timeFootIcon.addClass('switch-calendar');
163 //            timeFootIcon.addClass('glyphicon-calendar');
164 //            
165 //            dayFootIcon.addClass('switch-time');
166 //            dayFootIcon.addClass('glyphicon-time');
167             
168         this.pop.select('>span.hours-up', true).first().on('click', this.onIncrementHours, this);
169         this.pop.select('>span.hours-down', true).first().on('click', this.onDecrementHours, this);
170         this.pop.select('>span.minutes-up', true).first().on('click', this.onIncrementMinutes, this);
171         this.pop.select('>span.minutes-down', true).first().on('click', this.onDecrementMinutes, this);
172         this.pop.select('>button', true).first().on('click', this.onTogglePeriod, this);
173
174 //        }else{
175 //            Roo.each(this.picker().select('tfoot th', true).elements, function(v){
176 //                v.remove();
177 //            });
178 //        }
179 //        
180 //        if(this.isInline) {
181 //            this.show();
182 //        }
183     },
184     
185     picker : function()
186     {
187         return this.el.select('.datepicker', true).first();
188     },
189     
190     fillTime: function()
191     {    
192         Roo.log(this.pop);
193         var time = this.pop.select('tbody', true).first();
194         
195         time.dom.innerHTML = '';
196         
197         time.createChild({
198             tag: 'tr',
199             cn: [
200                 {
201                     tag: 'td',
202                     cn: [
203                         {
204                             tag: 'a',
205                             href: '#',
206                             cls: 'btn',
207                             cn: [
208                                 {
209                                     tag: 'span',
210                                     cls: 'hours-up glyphicon glyphicon-chevron-up'
211                                 }
212                             ]
213                         } 
214                     ]
215                 },
216                 {
217                     tag: 'td',
218                     cls: 'separator'
219                 },
220                 {
221                     tag: 'td',
222                     cn: [
223                         {
224                             tag: 'a',
225                             href: '#',
226                             cls: 'btn',
227                             cn: [
228                                 {
229                                     tag: 'span',
230                                     cls: 'minutes-up glyphicon glyphicon-chevron-up'
231                                 }
232                             ]
233                         }
234                     ]
235                 },
236                 {
237                     tag: 'td',
238                     cls: 'separator'
239                 }
240             ]
241         });
242         
243         time.createChild({
244             tag: 'tr',
245             cn: [
246                 {
247                     tag: 'td',
248                     cn: [
249                         {
250                             tag: 'span',
251                             cls: 'timepicker-hour',
252                             html: '00'
253                         }  
254                     ]
255                 },
256                 {
257                     tag: 'td',
258                     cls: 'separator',
259                     html: ':'
260                 },
261                 {
262                     tag: 'td',
263                     cn: [
264                         {
265                             tag: 'span',
266                             cls: 'timepicker-minute',
267                             html: '00'
268                         }  
269                     ]
270                 },
271                 {
272                     tag: 'td',
273                     cls: 'separator'
274                 },
275                 {
276                     tag: 'td',
277                     cn: [
278                         {
279                             tag: 'button',
280                             type: 'button',
281                             cls: 'btn btn-primary',
282                             html: 'AM'
283                             
284                         }
285                     ]
286                 }
287             ]
288         });
289         
290         time.createChild({
291             tag: 'tr',
292             cn: [
293                 {
294                     tag: 'td',
295                     cn: [
296                         {
297                             tag: 'a',
298                             href: '#',
299                             cls: 'btn',
300                             cn: [
301                                 {
302                                     tag: 'span',
303                                     cls: 'hours-down glyphicon glyphicon-chevron-down'
304                                 }
305                             ]
306                         }
307                     ]
308                 },
309                 {
310                     tag: 'td',
311                     cls: 'separator'
312                 },
313                 {
314                     tag: 'td',
315                     cn: [
316                         {
317                             tag: 'a',
318                             href: '#',
319                             cls: 'btn',
320                             cn: [
321                                 {
322                                     tag: 'span',
323                                     cls: 'minutes-down glyphicon glyphicon-chevron-down'
324                                 }
325                             ]
326                         }
327                     ]
328                 },
329                 {
330                     tag: 'td',
331                     cls: 'separator'
332                 }
333             ]
334         });
335         
336     },
337     
338     update: function()
339     {
340         
341         this.time = (typeof(this.time) === 'undefined') ? new Date() : this.time;
342         
343         this.fill();
344     },
345     
346     fill: function() 
347     {
348         var hours = this.time.getHours();
349         var minutes = this.time.getMinutes();
350         var period = 'AM';
351         
352         if(hours > 12){
353             hours = hours - 12;
354             period = 'PM';
355         }
356         
357         this.pop.select('>.timepicker-hour', true).first().el.dom.innerHTML = hours;
358         this.pop.select('>.timepicker-minute', true).first().el.dom.innerHTML = minutes;
359         this.pop.select('>button', true).first().el.dom.innerHTML = period;
360         
361     },
362 //    
363 //    showMode: function(dir) {
364 //        if (dir) {
365 //            this.viewMode = Math.max(this.minViewMode, Math.min(3, this.viewMode + dir));
366 //        }
367 //        
368 //        Roo.each(this.picker().select('>div',true).elements, function(v){
369 //            v.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
370 //            v.hide();
371 //        });
372 //        this.picker().select('>.datepicker-'+Roo.bootstrap.DateField.modes[this.viewMode].clsName, true).first().show();
373 //        
374 //    },
375     
376     place: function()
377     {
378 //        if(this.isInline) return;
379         
380         this.picker().removeClass(['bottom', 'top']);
381         
382         if((Roo.lib.Dom.getViewHeight() + Roo.get(document.body).getScroll().top) - (this.inputEl().getBottom() + this.picker().getHeight()) < 0){
383             /*
384              * place to the top of element!
385              *
386              */
387             
388             this.picker().addClass('top');
389             this.picker().setTop(0 - this.picker().getHeight()).setLeft(this.inputEl().getLeft() - this.el.getLeft());
390             
391             return;
392         }
393         
394         this.picker().addClass('bottom');
395         
396         this.picker().setTop(this.inputEl().getHeight()).setLeft(this.inputEl().getLeft() - this.el.getLeft());
397     },
398     
399 //    parseDate : function(value){
400 //        if(!value || value instanceof Date){
401 //            return value;
402 //        }
403 //        var v = Date.parseDate(value, this.format);
404 //        if (!v && this.useIso) {
405 //            v = Date.parseDate(value, 'Y-m-d');
406 //        }
407 //        if(!v && this.altFormats){
408 //            if(!this.altFormatsArray){
409 //                this.altFormatsArray = this.altFormats.split("|");
410 //            }
411 //            for(var i = 0, len = this.altFormatsArray.length; i < len && !v; i++){
412 //                v = Date.parseDate(value, this.altFormatsArray[i]);
413 //            }
414 //        }
415 //        return v;
416 //    },
417     
418 //    formatDate : function(date, fmt){
419 //        return (!date || !(date instanceof Date)) ?
420 //        date : date.dateFormat(fmt || this.format);
421 //    },
422     
423     onFocus : function()
424     {
425         Roo.bootstrap.TimeField.superclass.onFocus.call(this);
426         this.show();
427     },
428     
429     onBlur : function()
430     {
431         Roo.bootstrap.TimeField.superclass.onBlur.call(this);
432         this.hide();
433     },
434     
435     show : function()
436     {
437         this.picker().show();
438         this.pop.show();
439         this.update();
440         this.place();
441     },
442     
443     hide : function()
444     {
445         this.picker().hide();
446         this.pop.hide();
447         
448     },
449     
450     onMousedown: function(e){
451         e.stopPropagation();
452         e.preventDefault();
453     },
454 //    
455 //    keyup: function(e){
456 //        Roo.bootstrap.DateField.superclass.keyup.call(this);
457 //        this.update();
458 //        
459 //    },
460     
461 //    fireKey: function(e){
462 //        if (!this.picker().isVisible()){
463 //            if (e.keyCode == 27) // allow escape to hide and re-show picker
464 //                this.show();
465 //            return;
466 //        }
467 //        var dateChanged = false,
468 //        dir, day, month,
469 //        newDate, newViewDate;
470 //        switch(e.keyCode){
471 //            case 27: // escape
472 //                this.hide();
473 //                e.preventDefault();
474 //                break;
475 //            case 37: // left
476 //            case 39: // right
477 //                if (!this.keyboardNavigation) break;
478 //                dir = e.keyCode == 37 ? -1 : 1;
479 //                
480 //                if (e.ctrlKey){
481 //                    newDate = this.moveYear(this.date, dir);
482 //                    newViewDate = this.moveYear(this.viewDate, dir);
483 //                } else if (e.shiftKey){
484 //                    newDate = this.moveMonth(this.date, dir);
485 //                    newViewDate = this.moveMonth(this.viewDate, dir);
486 //                } else {
487 //                    newDate = new Date(this.date);
488 //                    newDate.setUTCDate(this.date.getUTCDate() + dir);
489 //                    newViewDate = new Date(this.viewDate);
490 //                    newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir);
491 //                }
492 //                if (this.dateWithinRange(newDate)){
493 //                    this.date = newDate;
494 //                    this.viewDate = newViewDate;
495 //                    this.setValue(this.formatDate(this.date));
496 //                    this.update();
497 //                    e.preventDefault();
498 //                    dateChanged = true;
499 //                }
500 //                break;
501 //            case 38: // up
502 //            case 40: // down
503 //                if (!this.keyboardNavigation) break;
504 //                dir = e.keyCode == 38 ? -1 : 1;
505 //                if (e.ctrlKey){
506 //                    newDate = this.moveYear(this.date, dir);
507 //                    newViewDate = this.moveYear(this.viewDate, dir);
508 //                } else if (e.shiftKey){
509 //                    newDate = this.moveMonth(this.date, dir);
510 //                    newViewDate = this.moveMonth(this.viewDate, dir);
511 //                } else {
512 //                    newDate = new Date(this.date);
513 //                    newDate.setUTCDate(this.date.getUTCDate() + dir * 7);
514 //                    newViewDate = new Date(this.viewDate);
515 //                    newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7);
516 //                }
517 //                if (this.dateWithinRange(newDate)){
518 //                    this.date = newDate;
519 //                    this.viewDate = newViewDate;
520 //                    this.setValue(this.formatDate(this.date));
521 //                    this.update();
522 //                    e.preventDefault();
523 //                    dateChanged = true;
524 //                }
525 //                break;
526 //            case 13: // enter
527 //                this.setValue(this.formatDate(this.date));
528 //                this.hide();
529 //                e.preventDefault();
530 //                break;
531 //            case 9: // tab
532 //                this.setValue(this.formatDate(this.date));
533 //                this.hide();
534 //                break;
535 //        }
536 //    },
537     
538     
539     onClick: function(e) {
540         e.stopPropagation();
541         e.preventDefault();
542         
543         var target = e.getTarget();
544         
545 //        if(target.nodeName.toLowerCase() === 'i'){
546 //            target = Roo.get(target).dom.parentNode;
547 //        }
548         
549         var nodeName = target.nodeName.trim();
550         var className = target.className.trim();
551         var html = target.innerHTML;
552         
553         Roo.log('nodeName');
554         Roo.log(nodeName);
555         
556         Roo.log('className');
557         Roo.log(className);
558         
559         Roo.log('html');
560         Roo.log(html);
561         
562         
563 //        switch(nodeName.toLowerCase()) {
564 //            case 'th':
565 //                switch(className) {
566 //                    case 'switch':
567 //                        this.showMode(1);
568 //                        break;
569 //                    case 'prev':
570 //                    case 'next':
571 //                        var dir = Roo.bootstrap.DateField.modes[this.viewMode].navStep * (className == 'prev' ? -1 : 1);
572 //                        switch(this.viewMode){
573 //                                case 0:
574 //                                        this.viewDate = this.moveMonth(this.viewDate, dir);
575 //                                        break;
576 //                                case 1:
577 //                                case 2:
578 //                                        this.viewDate = this.moveYear(this.viewDate, dir);
579 //                                        break;
580 //                        }
581 //                        this.fill();
582 //                        break;
583 //                    case 'today':
584 //                        var date = new Date();
585 //                        this.date = this.UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
586 //                        this.fill()
587 //                        this.setValue(this.formatDate(this.date));
588 //                        this.hide();
589 //                        break;
590 //                     case 'switch-time':
591 //                        this.showMode(-1);
592 //                        this.fill();
593 //                        break;
594 //                     case 'switch-calendar':
595 //                         this.showMode(1);
596 //                         this.fill();
597 //                         break;
598 //                }
599 //                break;
600 //            case 'span':
601 //                if (className.indexOf('disabled') === -1) {
602 //                    this.viewDate.setUTCDate(1);
603 //                    if (className.indexOf('month') !== -1) {
604 //                        this.viewDate.setUTCMonth(Roo.bootstrap.DateField.dates[this.language].monthsShort.indexOf(html));
605 //                    } else if(className.indexOf('picker-switch-icon') !== -1){
606 //                        if(className.indexOf('switch-time') !== -1){
607 //                            this.showMode(-1);
608 //                            this.fill();
609 //                        }else{
610 //                            this.showMode(1);
611 //                            this.fill();
612 //                        }
613 //                        
614 //                        break;
615 //                        
616 //                    } else {
617 //                        var year = parseInt(html, 10) || 0;
618 //                        this.viewDate.setUTCFullYear(year);
619 //                        
620 //                    }
621 //                    this.showMode(-1);
622 //                    this.fill();
623 //                }
624 //                break;
625 //                
626 //            case 'td':
627 //                if (className.indexOf('day') !== -1 && className.indexOf('disabled') === -1){
628 //                    var day = parseInt(html, 10) || 1;
629 //                    var year = this.viewDate.getUTCFullYear(),
630 //                        month = this.viewDate.getUTCMonth();
631 //
632 //                    if (className.indexOf('old') !== -1) {
633 //                        if(month === 0 ){
634 //                            month = 11;
635 //                            year -= 1;
636 //                        }else{
637 //                            month -= 1;
638 //                        }
639 //                    } else if (className.indexOf('new') !== -1) {
640 //                        if (month == 11) {
641 //                            month = 0;
642 //                            year += 1;
643 //                        } else {
644 //                            month += 1;
645 //                        }
646 //                    }
647 //                    this.date = this.UTCDate(year, month, day,0,0,0,0);
648 //                    this.viewDate = this.UTCDate(year, month, Math.min(28, day),0,0,0,0);
649 //                    this.fill();
650 //                    this.setValue(this.formatDate(this.date));
651 //                    this.hide();
652 //                }
653 //                break;
654 //        }
655     },
656     
657 //    setStartDate: function(startDate){
658 //        this.startDate = startDate || -Infinity;
659 //        if (this.startDate !== -Infinity) {
660 //            this.startDate = this.parseDate(this.startDate);
661 //        }
662 //        this.update();
663 //        this.updateNavArrows();
664 //    },
665 //
666 //    setEndDate: function(endDate){
667 //        this.endDate = endDate || Infinity;
668 //        if (this.endDate !== Infinity) {
669 //            this.endDate = this.parseDate(this.endDate);
670 //        }
671 //        this.update();
672 //        this.updateNavArrows();
673 //    },
674 //    
675 //    setDaysOfWeekDisabled: function(daysOfWeekDisabled){
676 //        this.daysOfWeekDisabled = daysOfWeekDisabled || [];
677 //        if (typeof(this.daysOfWeekDisabled) !== 'object') {
678 //            this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/);
679 //        }
680 //        this.daysOfWeekDisabled = this.daysOfWeekDisabled.map(function (d) {
681 //            return parseInt(d, 10);
682 //        });
683 //        this.update();
684 //        this.updateNavArrows();
685 //    },
686 //    
687 //    updateNavArrows: function() {
688 //        var d = new Date(this.viewDate),
689 //        year = d.getUTCFullYear(),
690 //        month = d.getUTCMonth();
691 //        
692 //        Roo.each(this.picker().select('.prev', true).elements, function(v){
693 //            v.show();
694 //            switch (this.viewMode) {
695 //                case 0:
696 //
697 //                    if (this.startDate !== -Infinity && year <= this.startDate.getUTCFullYear() && month <= this.startDate.getUTCMonth()) {
698 //                        v.hide();
699 //                    }
700 //                    break;
701 //                case 1:
702 //                case 2:
703 //                    if (this.startDate !== -Infinity && year <= this.startDate.getUTCFullYear()) {
704 //                        v.hide();
705 //                    }
706 //                    break;
707 //            }
708 //        });
709 //        
710 //        Roo.each(this.picker().select('.next', true).elements, function(v){
711 //            v.show();
712 //            switch (this.viewMode) {
713 //                case 0:
714 //
715 //                    if (this.endDate !== Infinity && year >= this.endDate.getUTCFullYear() && month >= this.endDate.getUTCMonth()) {
716 //                        v.hide();
717 //                    }
718 //                    break;
719 //                case 1:
720 //                case 2:
721 //                    if (this.endDate !== Infinity && year >= this.endDate.getUTCFullYear()) {
722 //                        v.hide();
723 //                    }
724 //                    break;
725 //            }
726 //        })
727 //    },
728 //    
729 //    moveMonth: function(date, dir){
730 //        if (!dir) return date;
731 //        var new_date = new Date(date.valueOf()),
732 //        day = new_date.getUTCDate(),
733 //        month = new_date.getUTCMonth(),
734 //        mag = Math.abs(dir),
735 //        new_month, test;
736 //        dir = dir > 0 ? 1 : -1;
737 //        if (mag == 1){
738 //            test = dir == -1
739 //            // If going back one month, make sure month is not current month
740 //            // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
741 //            ? function(){
742 //                return new_date.getUTCMonth() == month;
743 //            }
744 //            // If going forward one month, make sure month is as expected
745 //            // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
746 //            : function(){
747 //                return new_date.getUTCMonth() != new_month;
748 //            };
749 //            new_month = month + dir;
750 //            new_date.setUTCMonth(new_month);
751 //            // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
752 //            if (new_month < 0 || new_month > 11)
753 //                new_month = (new_month + 12) % 12;
754 //        } else {
755 //            // For magnitudes >1, move one month at a time...
756 //            for (var i=0; i<mag; i++)
757 //                // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
758 //                new_date = this.moveMonth(new_date, dir);
759 //            // ...then reset the day, keeping it in the new month
760 //            new_month = new_date.getUTCMonth();
761 //            new_date.setUTCDate(day);
762 //            test = function(){
763 //                return new_month != new_date.getUTCMonth();
764 //            };
765 //        }
766 //        // Common date-resetting loop -- if date is beyond end of month, make it
767 //        // end of month
768 //        while (test()){
769 //            new_date.setUTCDate(--day);
770 //            new_date.setUTCMonth(new_month);
771 //        }
772 //        return new_date;
773 //    },
774 //
775 //    moveYear: function(date, dir){
776 //        return this.moveMonth(date, dir*12);
777 //    },
778 //
779 //    dateWithinRange: function(date){
780 //        return date >= this.startDate && date <= this.endDate;
781 //    },
782
783 //    remove: function() {
784 //        this.picker().remove();
785 //    },
786     
787     onIncrementHours: function()
788     {
789         Roo.log('onIncrementHours');
790     },
791     
792     onDecrementHours: function()
793     {
794         Roo.log('onDecrementHours');
795     },
796     
797     onIncrementMinutes: function()
798     {
799         Roo.log('onIncrementMinutes');
800     },
801     
802     onDecrementMinutes: function()
803     {
804         Roo.log('onDecrementMinutes');
805     },
806     
807     onTogglePeriod: function()
808     {
809         Roo.log('onTogglePeriod');
810     }
811     
812    
813 });
814
815 Roo.apply(Roo.bootstrap.TimeField,  {
816     
817     content : {
818         tag: 'tbody',
819         cn: [
820         {
821             tag: 'tr',
822             cn: [
823             {
824                 tag: 'td',
825                 colspan: '7'
826             }
827             ]
828         }
829         ]
830     }
831 });
832
833 Roo.apply(Roo.bootstrap.TimeField,  {
834   
835     template : {
836         tag: 'div',
837         cls: 'datepicker dropdown-menu',
838         cn: [
839             {
840                 tag: 'div',
841                 cls: 'datepicker-time',
842                 cn: [
843                 {
844                     tag: 'table',
845                     cls: 'table-condensed',
846                     cn:[
847                     Roo.bootstrap.DateField.content
848                     ]
849                 }
850                 ]
851             }
852         ]
853     }
854 });
855
856  
857
858