From b033383a2cda78515024bbb648a5b40de6598ad6 Mon Sep 17 00:00:00 2001 From: leon Date: Mon, 19 Dec 2022 15:31:09 +0800 Subject: [PATCH] fix #7444-New_Customer_Portal_200_Design --- Roo/bootstrap/form/TimeField.js | 6 ++++-- roojs-bootstrap-debug.js | 6 ++++-- roojs-bootstrap.js | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Roo/bootstrap/form/TimeField.js b/Roo/bootstrap/form/TimeField.js index 4138a9756b..9a8d12232f 100644 --- a/Roo/bootstrap/form/TimeField.js +++ b/Roo/bootstrap/form/TimeField.js @@ -9,6 +9,7 @@ * @class Roo.bootstrap.form.TimeField * @extends Roo.bootstrap.form.Input * Bootstrap DateField class + * @cfg {Number} minuteStep the minutes goes up/down by a fixed number, default 1 * * * @constructor @@ -51,6 +52,7 @@ Roo.extend(Roo.bootstrap.form.TimeField, Roo.bootstrap.form.Input, { * valid according to {@link Date#parseDate} (defaults to 'H:i'). */ format : "H:i", + minuteStep : 1, getAutoCreate : function() { @@ -431,14 +433,14 @@ Roo.extend(Roo.bootstrap.form.TimeField, Roo.bootstrap.form.Input, { onIncrementMinutes: function() { Roo.log('onIncrementMinutes'); - this.time = this.time.add(Date.MINUTE, 1); + this.time = this.time.add(Date.MINUTE, this.minuteStep); this.update(); }, onDecrementMinutes: function() { Roo.log('onDecrementMinutes'); - this.time = this.time.add(Date.MINUTE, -1); + this.time = this.time.add(Date.MINUTE, -1 * this.minuteStep); this.update(); }, diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index add16b4037..bba09221a5 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -23973,6 +23973,7 @@ Roo.apply(Roo.bootstrap.form.DateField, { * @class Roo.bootstrap.form.TimeField * @extends Roo.bootstrap.form.Input * Bootstrap DateField class + * @cfg {Number} minuteStep the minutes goes up/down by a fixed number, default 1 * * * @constructor @@ -24015,6 +24016,7 @@ Roo.extend(Roo.bootstrap.form.TimeField, Roo.bootstrap.form.Input, { * valid according to {@link Date#parseDate} (defaults to 'H:i'). */ format : "H:i", + minuteStep : 1, getAutoCreate : function() { @@ -24395,14 +24397,14 @@ Roo.extend(Roo.bootstrap.form.TimeField, Roo.bootstrap.form.Input, { onIncrementMinutes: function() { Roo.log('onIncrementMinutes'); - this.time = this.time.add(Date.MINUTE, 1); + this.time = this.time.add(Date.MINUTE, this.minuteStep); this.update(); }, onDecrementMinutes: function() { Roo.log('onDecrementMinutes'); - this.time = this.time.add(Date.MINUTE, -1); + this.time = this.time.add(Date.MINUTE, -1 * this.minuteStep); this.update(); }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 2524b1a4d5..427d55051f 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1015,7 +1015,7 @@ if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}if ,Roo.bootstrap.form.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,Roo.bootstrap.form.DateField.content,Roo.bootstrap.form.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,Roo.bootstrap.form.DateField.content,Roo.bootstrap.form.DateField.footer]} ]}]}}); // Roo/bootstrap/form/TimeField.js -Roo.bootstrap.form.TimeField=function(A){Roo.bootstrap.form.TimeField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.TimeField,Roo.bootstrap.form.Input,{format:"H:i",getAutoCreate:function(){this.after=''; +Roo.bootstrap.form.TimeField=function(A){Roo.bootstrap.form.TimeField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.TimeField,Roo.bootstrap.form.Input,{format:"H:i",minuteStep:1,getAutoCreate:function(){this.after=''; return Roo.bootstrap.form.TimeField.superclass.getAutoCreate.call(this);},onRender:function(ct,A){Roo.bootstrap.form.TimeField.superclass.onRender.call(this,ct,A);this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.TimeField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; this.pop=this.picker().select('>.datepicker-time',true).first();this.pop.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown'); this.fillTime();this.update();this.pop.select('.hours-up',true).first().on('click',this.onIncrementHours,this);this.pop.select('.hours-down',true).first().on('click',this.onDecrementHours,this);this.pop.select('.minutes-up',true).first().on('click',this.onIncrementMinutes,this); @@ -1031,8 +1031,8 @@ A.push('top');}A.push('right');if((Roo.lib.Dom.getViewWidth()+Roo.get(document.b ).defer(200);B.picker().alignTo(B.inputEl(),"tr-br",[0,10],false);return;}if(c=='top'){B.picker().alignTo(B.inputEl(),"br-tr",[0,10],false);return;}});},onFocus:function(){Roo.bootstrap.form.TimeField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.form.TimeField.superclass.onBlur.call(this); this.hide();},show:function(){this.picker().show();this.pop.show();this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){this.picker().hide();this.pop.hide();this.fireEvent('hide',this,this.date);},setTime:function(){this.hide(); this.setValue(this.time.format(this.format));this.fireEvent('select',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},onIncrementHours:function(){Roo.log('onIncrementHours');this.time=this.time.add(Date.HOUR,1);this.update(); -},onDecrementHours:function(){Roo.log('onDecrementHours');this.time=this.time.add(Date.HOUR,-1);this.update();},onIncrementMinutes:function(){Roo.log('onIncrementMinutes');this.time=this.time.add(Date.MINUTE,1);this.update();},onDecrementMinutes:function(){Roo.log('onDecrementMinutes'); -this.time=this.time.add(Date.MINUTE,-1);this.update();},onTogglePeriod:function(){Roo.log('onTogglePeriod');this.time=this.time.add(Date.HOUR,12);this.update();}});Roo.apply(Roo.bootstrap.form.TimeField,{template:{tag:'div',cls:'datepicker dropdown-menu',cn:[{tag:'div',cls:'datepicker-time',cn:[{tag:'table',cls:'table-condensed',cn:[{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'} +},onDecrementHours:function(){Roo.log('onDecrementHours');this.time=this.time.add(Date.HOUR,-1);this.update();},onIncrementMinutes:function(){Roo.log('onIncrementMinutes');this.time=this.time.add(Date.MINUTE,this.minuteStep);this.update();},onDecrementMinutes:function(){Roo.log('onDecrementMinutes'); +this.time=this.time.add(Date.MINUTE,-1*this.minuteStep);this.update();},onTogglePeriod:function(){Roo.log('onTogglePeriod');this.time=this.time.add(Date.HOUR,12);this.update();}});Roo.apply(Roo.bootstrap.form.TimeField,{template:{tag:'div',cls:'datepicker dropdown-menu',cn:[{tag:'div',cls:'datepicker-time',cn:[{tag:'table',cls:'table-condensed',cn:[{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'} ]}]},{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'',cn:[{tag:'button',cls:'btn btn-info ok',html:'OK'}]}]}]}]}]}]}}); // Roo/bootstrap/form/MonthField.js Roo.bootstrap.form.MonthField=function(A){Roo.bootstrap.form.MonthField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.MonthField,Roo.bootstrap.form.Input,{onRender:function(ct,A){Roo.bootstrap.form.MonthField.superclass.onRender.call(this,ct,A); -- 2.39.2