From 3165dbcdcb6e9f69096fed311c21983a77cda40f Mon Sep 17 00:00:00 2001 From: ipuppet Date: Sun, 2 Oct 2022 01:14:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=81=E5=B1=8F=E5=B0=8F?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/widget/Calendar/calendar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/widget/Calendar/calendar.js b/scripts/widget/Calendar/calendar.js index 61c237e..d196aec 100644 --- a/scripts/widget/Calendar/calendar.js +++ b/scripts/widget/Calendar/calendar.js @@ -669,12 +669,12 @@ class Calendar { const week = Math.ceil(saturday / 7) // start from 1 const length = this.calendar.calendar.length const weekStart = week + 2 > length ? length - 2 : week - const weekLength = Math.min(weekStart + 2, length) // 最多显示 3 周 - this.calendar.calendar = this.calendar.calendar.slice(weekStart - 1, weekLength) + const weekEnd = Math.min(weekStart + 2, length) // 最多显示 3 周 + this.calendar.calendar = this.calendar.calendar.slice(weekStart - 1, weekEnd) // 生成视图 const days = this.weekIndexTemplate().views - for (let i = weekStart - 1; i < weekLength; i++) { + for (let i = 0; i < this.calendar.calendar.length; i++) { // 设置不同日期显示不同样式 for (let dayInfo of this.calendar.calendar[i]) { const props = this.singleContentDayStyleModifier(dayInfo)