From 6f8c882946e99cb70e20780685e9678a8959fc2a Mon Sep 17 00:00:00 2001 From: Soon Date: Wed, 18 Apr 2018 14:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93type:=20'month'?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E6=9C=88=E4=BB=BD=EF=BC=8C?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8=E6=9C=AA=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=85=B3=E9=97=AD=E7=9A=84issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/laydate.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/laydate.js b/src/laydate.js index 0a75401..f444e68 100644 --- a/src/laydate.js +++ b/src/laydate.js @@ -1255,6 +1255,17 @@ isAlone && (that[['startDate', 'endDate'][index]].year = ym); that.list('month', index); } + /** + * 如果非范围选择,且为年月选择器,点击了月列表,则完成年月选择,关闭选择器列表 + * @author J.Soon + */ + if (!options.range) { + if(options.type === 'month' && type === 'month'){ + that.checkDate('limit').calendar(); + that.done(); + that.setValue(that.parse()).remove(); + } + } } else { that.checkDate('limit').calendar(); that.closeList();