From 2a9f64c76a66948edeac6515c4cf1a90fa99455a Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <470459819@qq.com> Date: Fri, 9 Dec 2022 10:59:43 +0800 Subject: [PATCH] =?UTF-8?q?laydate=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=97=B6=E8=BF=9B=E5=85=A5done=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E7=9A=84=E6=97=B6=E5=80=99=E5=8F=82=E6=95=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/laydate.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 78973e48..23f88724 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -607,7 +607,7 @@ that.choose(lay(elem).find('td.layui-this')) } else if (type === 'year' || type === 'month') { if(lay(elemMain[0]).find('.' + ELEM_MAIN + ' li.' + THIS + ':not(.laydate-disabled)')[0]) { - that.setValue(that.parse()).remove().done(); + that.setValue(that.parse()).done().remove(); } } } @@ -1412,7 +1412,7 @@ //且在范围未开启时 if(!options.range && options.autoConfirm){ if((options.type === 'month' && type === 'month') || (options.type === 'year' && type === 'year')){ - that.setValue(that.parse()).remove().done(); + that.setValue(that.parse()).done().remove(); } } @@ -1814,7 +1814,7 @@ } else if(options.position === 'static'){ //直接嵌套的选中 that.calendar().done().done(null, 'change'); //同时执行 done 和 change 回调 } else if(options.type === 'date'){ - options.autoConfirm ? that.setValue(that.parse()).remove().done() : that.calendar().done(null, 'change'); + options.autoConfirm ? that.setValue(that.parse()).done().remove() : that.calendar().done(null, 'change'); } else if(options.type === 'datetime'){ that.calendar().done(null, 'change'); } @@ -1854,8 +1854,8 @@ ,delete that.startTime ,delete that.endTime ); - that.setValue('').remove(); - that.done(['', {}, {}]); + that.setValue(''); + that.done(['', {}, {}]).remove(); } // 现在 @@ -1873,9 +1873,9 @@ ,seconds: thisDate.getSeconds() }); - that.setValue(that.parse()).remove(); + that.setValue(that.parse()); isStatic && that.calendar(); - that.done(); + that.done().remove(); } //确定 @@ -1888,8 +1888,8 @@ if(lay(btn).hasClass(DISABLED)) return that.hint(lang.invalidDate); } - that.setValue(that.parse()).remove(); - that.done(); + that.setValue(that.parse()); + that.done().remove(); } }; active[type] && active[type]();