From 5fb27a3619166408def566fea3f9e3b10013593b Mon Sep 17 00:00:00 2001 From: Kam Low Date: Thu, 30 Mar 2023 10:40:27 +1000 Subject: [PATCH 1/3] Fix issue where incorrect weekday labels were being displayed when startWeekOnSunday was set to true. --- src/vue-cal/index.vue | 2 +- src/vue-cal/weekdays-headings.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vue-cal/index.vue b/src/vue-cal/index.vue index dc70d82e..53038d87 100644 --- a/src/vue-cal/index.vue +++ b/src/vue-cal/index.vue @@ -1600,7 +1600,7 @@ export default { const weekDays = this.weekDays cells = weekDays.map((cell, i) => { - const startDate = ud.addDays(firstDayOfWeek, this.startWeekOnSunday ? i - 1 : i) + const startDate = ud.addDays(firstDayOfWeek, this.startWeekOnSunday && this.hideWeekends ? i - 1 : i) const endDate = new Date(startDate) endDate.setHours(23, 59, 59, 0) // End at 23:59:59. const dayOfWeek = (startDate.getDay() || 7) - 1 // Day of the week from 0 to 6 with 6 = Sunday. diff --git a/src/vue-cal/weekdays-headings.vue b/src/vue-cal/weekdays-headings.vue index 2db28346..0e6df6fa 100644 --- a/src/vue-cal/weekdays-headings.vue +++ b/src/vue-cal/weekdays-headings.vue @@ -53,7 +53,7 @@ export default { let todayFound = false const headings = this.weekDays.map((cell, i) => { - const date = this.utils.date.addDays(this.view.startDate, this.vuecal.startWeekOnSunday ? i - 1 : i) + const date = this.utils.date.addDays(this.view.startDate, this.vuecal.startWeekOnSunday && this.vuecal.hideWeekends ? i - 1 : i) return { hide: cell.hide, From 4dd6586fa4404bcc0afd257ca484451dadde97ef Mon Sep 17 00:00:00 2001 From: Kam Low Date: Thu, 30 Mar 2023 11:04:10 +1000 Subject: [PATCH 2/3] Debugging. --- src/vue-cal/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vue-cal/index.vue b/src/vue-cal/index.vue index 53038d87..0773b53a 100644 --- a/src/vue-cal/index.vue +++ b/src/vue-cal/index.vue @@ -1255,6 +1255,7 @@ export default { }, mounted () { + console.log('vue-cal index mounted: https://github.com/chillburn/vue-cal.git#bugfix/start-week-on-sunday-incorrect-labels') const ud = this.utils.date const hasTouch = 'ontouchstart' in window const { resize, drag, create, delete: deletable, title } = this.editEvents From b0371c79e635c0abb881df226184325340d45af1 Mon Sep 17 00:00:00 2001 From: Gavin Bruce Date: Thu, 30 Mar 2023 14:51:32 +1000 Subject: [PATCH 3/3] Remove Debugging. --- src/vue-cal/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vue-cal/index.vue b/src/vue-cal/index.vue index 0773b53a..53038d87 100644 --- a/src/vue-cal/index.vue +++ b/src/vue-cal/index.vue @@ -1255,7 +1255,6 @@ export default { }, mounted () { - console.log('vue-cal index mounted: https://github.com/chillburn/vue-cal.git#bugfix/start-week-on-sunday-incorrect-labels') const ud = this.utils.date const hasTouch = 'ontouchstart' in window const { resize, drag, create, delete: deletable, title } = this.editEvents