From 47fade228abde20389df036ad0fe20772ff5bb5b Mon Sep 17 00:00:00 2001 From: gjianbo Date: Thu, 4 Apr 2019 10:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0yearChang=E9=80=89=E9=A1=B9,?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E8=AE=BE=E7=BD=AE=E5=88=87=E6=8D=A2=E5=B9=B4?= =?UTF-8?q?=E4=BB=BD=E6=97=B6=E6=98=AF=E5=90=A6=E8=A7=A6=E5=8F=91chang?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/laydate.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/laydate.js b/src/laydate.js index 0a75401..ec51d64 100644 --- a/src/laydate.js +++ b/src/laydate.js @@ -391,6 +391,7 @@ ,zIndex: null //控件层叠顺序 ,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发 ,change: null //日期时间改变后的回调 + ,yearChange:true //年切换时触发事件 }; //多语言 @@ -1668,7 +1669,7 @@ year: listYM[0] }); if(isAlone) that[startEnd].year = listYM[0]; - options.range || that.done(null, 'change'); + options.range || (options.yearChange && that.done(null, 'change')); that.setBtnStatus(); options.range || that.limit(lay(that.footer).find(ELEM_CONFIRM), { year: listYM[0] @@ -1682,7 +1683,7 @@ if(addSubYeay('sub')) return; dateTime.year--; that.checkDate('limit').calendar(); - options.range || that.done(null, 'change'); + options.range || (options.yearChange && that.done(null, 'change')); } ,prevMonth: function(){ var YM = that.getAsYM(dateTime.year, dateTime.month, 'sub'); @@ -1706,7 +1707,7 @@ if(addSubYeay()) return; dateTime.year++ that.checkDate('limit').calendar(); - options.range || that.done(null, 'change'); + options.range || (options.yearChange && that.done(null, 'change')); } }; };