添加了monthChang配置用于切换月份是否触发chang事件

pull/82/head
gjianbo 2019-04-04 10:52:34 +08:00
parent 47fade228a
commit 44b3729b7d
5 changed files with 2770 additions and 5 deletions

2
dist/laydate.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2763
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
{ {
"name": "layui-laydate", "name": "layui-laydate",
"realname": "laydate", "realname": "laydate",
"version": "5.0.9", "version": "5.0.9",

View File

@ -392,6 +392,8 @@
,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发 ,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发
,change: null //日期时间改变后的回调 ,change: null //日期时间改变后的回调
,yearChange:true //年切换时触发事件 ,yearChange:true //年切换时触发事件
,monthChange:true //月切换时触发事件
}; };
//多语言 //多语言
@ -1692,7 +1694,7 @@
,month: YM[1] ,month: YM[1]
}); });
that.checkDate('limit').calendar(); that.checkDate('limit').calendar();
options.range || that.done(null, 'change'); options.range || (options.monthChange && that.done(null, 'change'));
} }
,nextMonth: function(){ ,nextMonth: function(){
var YM = that.getAsYM(dateTime.year, dateTime.month); var YM = that.getAsYM(dateTime.year, dateTime.month);
@ -1701,7 +1703,7 @@
,month: YM[1] ,month: YM[1]
}); });
that.checkDate('limit').calendar(); that.checkDate('limit').calendar();
options.range || that.done(null, 'change'); options.range || (options.monthChange && that.done(null, 'change'));
} }
,nextYear: function(){ ,nextYear: function(){
if(addSubYeay()) return; if(addSubYeay()) return;