From f15fd618f8f594ac5cee5d3496f15459955d5e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Mon, 11 Sep 2023 09:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20laydate=20=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/laydate.html | 50 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/examples/laydate.html b/examples/laydate.html index 869faf35..20be4cc2 100644 --- a/examples/laydate.html +++ b/examples/laydate.html @@ -174,38 +174,44 @@ layui.use('laydate', function(laydate){ }); - //范围选择1 + // 范围选择1 laydate.render({ - elem: '#test1' //指定元素 - ,type: 'datetime' - ,trigger: 'click' - //,lang: 'en' - //,theme: 'grid' - ,range: true //开启日期范围,默认使用“-”分割 - //,min: '1970-1-1' - //,max: '2021-5-9' - //,value: '2021-05-09 12:06:09' - //,value: '2021-05-08 - 2021-03-27' - ,done: function(value, date, endDate){ + elem: '#test1', // 指定元素 + type: 'datetime', + trigger: 'click', + // lang: 'en', + // theme: 'grid', + range: true, // 开启日期范围,默认使用“-”分割 + // rangeLinked: true, + // min: '1970-1-1', + // max: '2021-5-9', + // value: '2021-05-09 12:06:09', + // value: '2021-05-08 - 2021-03-27', + done: function(value, date, endDate){ console.log(value, date, endDate); //this.elem.val(123); - } - ,change: function(value, date, endDate){ + }, + change: function(value, date, endDate){ console.log(value, date, endDate); } }); - //return; + // return; - //范围选择2 + // 范围选择2 laydate.render({ - elem: '#test1-2' - ,type: 'date' - ,range: ['#test-startDate-1', '#test-endDate-1'] - ,rangeLinked: true // 是否开启日期范围选择时的区间联动标注模式 - //,value: ['2022-05-01', '2022-06-01'] - //,value: '2022-05-01 - 2022-06-01' + elem: '#test1-2', + type: 'date', + range: ['#test-startDate-1', '#test-endDate-1'], + rangeLinked: true, // 是否开启日期范围选择时的区间联动标注模式 + // value: ['2022-05-01', '2022-10-01'], + // value: '2022-05-01 - 2022-06-01', + done: function (value, date, endDate) { + console.log(value); + console.log(date); + console.log(endDate); + } });