V-calendar: how to set a value

Created on 10 Jan 2020  路  6Comments  路  Source: nathanreyes/v-calendar

I using this plugin and it very good
so I want to set a Value

Most helpful comment

@nathanreyes any way to update the v-model range?

All 6 comments

Hi @hardworkerstudio , Personnaly I handle that on the range-picker by simulate a click on the day using the focustDate() method, when I only have the start or end date.

// waiting for the calendar display the date and focus it
await this.$refs.calendar.focusDate(date)

// Get the current dom element focused and trigger a click on it
document.activeElement.dispatchEvent(new Event('click'));

You can use updateValue: https://vcalendar.io/datepicker.html#use-custom-slot

this.$refs.calendar.updateValue(date)

Ho to updateValue with a range of date ?

@nathanreyes any way to update the v-model range?

this.$refs.calendar.updateValue(date) only update single date. How set date range?

It turned out to update range like this this.$refs.calendar.updateValue({start: new Date(), end: new Date()})

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mika76 picture mika76  路  3Comments

sokolovdm picture sokolovdm  路  3Comments

thfontaine picture thfontaine  路  3Comments

eafomi4ev picture eafomi4ev  路  3Comments

rcascante picture rcascante  路  3Comments