Closed anlek closed 8 years ago
My current work around works but isn't pretty:
// In my ready callback on my component I have:
this.$on('changeMonth', this.updateMonth)
// In methods
updateMonth (startDate, endDate) {
startDate = moment(startDate, 'YYYY-MM-DD')
endDate = moment(endDate, 'YYYY-MM-DD')
// Working date is now an average of the two dates,
// I have yet to find a case this doesn't work but it's still
// a lot of extra computation, where vue-fullcalendar knows
// the current day
this.workingDate = moment.unix(
(startDate.unix() + endDate.unix()) / 2
)
}
I also tried to send it the prop currentDate
and sync it but for some reason it didn't work (even though it seemed like it should have).
If there is another way to make this happen, please let me know.
Hey, I have added current
as 3rd arguments in event changeMonth
. You can check out both from npm and git.
Wow, thanks! That saves me time!
I've started working with
vue-fullcalendar
and during switching of the date, I found an issue of I didn't know what month I was switching to. ThechangeMonth
attributes arestart
andend
which give you the first date in the calendar and the last date. In most cases, it did not include the month it was currently on.(example: If I'm looking at September/2016, the
start
date is Aug 29th andend
date is Oct 10th, but the month I need to know is September 1st, 2016)Maybe it be a great idea to return
changeMonth
with (start
,end
,current
) dates. Where current is the first day of the month you changed to. Just a thought.