From b228ed09e460480c67549e611d10e1264c145358 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Wed, 30 Jun 2021 13:19:17 +0800 Subject: [PATCH] no message --- components/calendar/index.js | 18 ++++-------------- xtends/statics/index/index.js | 13 +++++++++---- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/components/calendar/index.js b/components/calendar/index.js index 7cc2132..8da8b0f 100644 --- a/components/calendar/index.js +++ b/components/calendar/index.js @@ -114,9 +114,7 @@ VantComponent({ scrollIntoView: '', }, created() { - this.setData({ - currentDate: this.getInitialDate(), - }); + this.setData({ currentDate: this.getInitialDate() }); }, mounted() { if (this.data.show || !this.data.poppable) { @@ -133,10 +131,7 @@ VantComponent({ if (this.contentObserver != null) { this.contentObserver.disconnect(); } - const contentObserver = this.createIntersectionObserver({ - thresholds: [0, 0.1, 0.9, 1], - observeAll: true, - }); + const contentObserver = this.createIntersectionObserver({ thresholds: [0, 0.1, 0.9, 1], observeAll: true }); this.contentObserver = contentObserver; contentObserver.relativeTo('.van-calendar__body'); contentObserver.observe('.month', (res) => { @@ -264,9 +259,7 @@ VantComponent({ }, emit(date) { const getTime = (date) => (date instanceof Date ? date.getTime() : date); - this.setData({ - currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), - }); + this.setData({ currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date) }); this.$emit('select', copyDates(date)); }, checkRange(date) { @@ -278,10 +271,7 @@ VantComponent({ return true; }, onConfirm() { - if ( - this.data.type === 'range' && - !this.checkRange(this.data.currentDate) - ) { + if (this.data.type === 'range' && !this.checkRange(this.data.currentDate)) { return; } wx.nextTick(() => { diff --git a/xtends/statics/index/index.js b/xtends/statics/index/index.js index ce4e298..2ce3ceb 100644 --- a/xtends/statics/index/index.js +++ b/xtends/statics/index/index.js @@ -67,13 +67,18 @@ Scene({ }, showCalendar: function(e){ this.data.selectId = e.currentTarget.id + var datetime = '' if(this.data.selectId == 'form1') { - var start = new Date(this.data.form1.dimensionDateStart + ' 00:00:00') - var end = new Date(this.data.form1.dimensionDateEnd + ' 00:00:00') + datetime = this.data.form1.dimensionDateStart + ' 00:00:00' + var start = new Date(datetime.replace(/-/g,'/')) + datetime = this.data.form1.dimensionDateEnd + ' 00:00:00' + var end = new Date(datetime.replace(/-/g,'/')) this.data.vdate = [start.getTime(), end.getTime()] } else { - var start = new Date(this.data.form2.dimensionDateStart + ' 00:00:00') - var end = new Date(this.data.form2.dimensionDateEnd + ' 00:00:00') + datetime = this.data.form2.dimensionDateStart + ' 00:00:00' + var start = new Date(datetime.replace(/-/g,'/')) + datetime = this.data.form2.dimensionDateEnd + ' 00:00:00' + var end = new Date(datetime.replace(/-/g,'/')) this.data.vdate = [start.getTime(), end.getTime()] } this.setData({ show: true, vdate: this.data.vdate })