I would like to be able to set selected dates of the vue functional-calendar (version 2.8.87) component (https://github.com/Digital-Threads/vue-functional-calendar). I set up the v-model and can detect dates selected by a mouse-click.
But if I set selected-dates from a javascript-function, the calendar does not update and actually mark/select these dates. Below code shows a minimum example. If anyone already accomplished this I would be very thankful for any advise.
<template>
<div>
<FunctionalCalendar
v-model="calendarData"
:configs="calendarConfigs"
ref="Calendar">
</FunctionalCalendar>
<b-form @submit="getCal">
<b-button class="button float-right" type="submit" variant="success">Submit</b-button>
</b-form>
</div>
</template>
<script>
import { FunctionalCalendar } from 'vue-functional-calendar';
export default {
components:{FunctionalCalendar},
name: 'CustomerArea',
data() {
return {
calendarData:{
selectedDates : []
},
calendarConfigs:{
isMultipleDatePicker : true
},
};
},
methods: {
getCal: function(){
console.log("getCal called");
this.calendarData.selectedDates = [{date: '21/7/2020'}];
}
}
};
</script>