From 67268d19701dc54e44f226075c5f8f2b3fab6541 Mon Sep 17 00:00:00 2001 From: soakit Date: Thu, 21 May 2020 17:29:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit range时,弹出面板支持选中结束日期 --- src/laydate.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/laydate.js b/src/laydate.js index 0a75401..cb56ae3 100644 --- a/src/laydate.js +++ b/src/laydate.js @@ -910,7 +910,11 @@ value = value.split(' '+ options.range +' '); that.startDate = that.startDate || that.systemDate(); that.endDate = that.endDate || that.systemDate(); - options.dateTime = lay.extend({}, that.startDate); + if (options.selectEndDate) { + options.dateTime = lay.extend({}, that.endDate); + } else { + options.dateTime = lay.extend({}, that.startDate); + } lay.each([that.startDate, that.endDate], function(i, item){ initDate(item, value[i], i); }); @@ -1863,4 +1867,4 @@ }() ); -}(); \ No newline at end of file +}();