I'm using v-calendar, I want to pass the default date to url and use it to set as the default date of the calendar.
The problem I faced with, is that v-calendar always shows the current date by default.
For example today is 30-01-2023 but I want to show the Feb of 2021.
I pass the default date in url query params.
My current code is like this:
<v-calendar
class="custom-calendar max-w-full"
:masks="masks"
:attributes="filteredEvents"
disable-page-swipe
is-expanded
:from-page="new Date(props.occurrence + '-01T:00:00')"
v-bind="{
fromDate: $props.occurrence ? new Date(occurrence+'01T00:00') : null,
}"
v-model="selectedDate"
@update:from-page="navigationHandler($event)"
>
<template v-slot:day-content="{ day, attributes }">
<CalendarDay :day="day" :attributes="attributes" />
</template>
</v-calendar>
If my props.occurrence = '2022-12
, still the $event.year
and month returns the current year and month.