Wanderxx / vue-fullcalendar

vue calendar fullCalendar. no jquery required. Schedule events management
https://wanderxx.github.io/vue-fullcalendar/
1.51k stars 387 forks source link

firstDay offset bug #13

Closed suitedjimster closed 7 years ago

suitedjimster commented 7 years ago

Hi, The issue i'm facing is if I want to start my week with "Monday". I could do first-day="1", but on Jan.2017, the month will start with Jan 2. I could do first-day="-6", but on Oct.2016, the month will end on Oct.30 (instead of 31st).

Any solution?

Wanderxx commented 7 years ago

Hi,

  1. any number less than 0 or larger than 6 should not be accepted. I just replaced the coerce with a validator.

  2. I set a diff to handle the issue when firstDay is larger than curWeekDay

let diff = parseInt(this.firstDay) - curWeekDay
if (diff) diff -= 7
startDate.setDate(startDate.getDate() + diff)

You could check out the latest version now.