vuelendar
vuelendar copied to clipboard
How to change the active month after initial selection?
Setting default-date to a new value doesn't change the active month being displayed
Here is what I tried https://codesandbox.io/s/vuelendar-simple-day-selector-obfxe?fontsize=14&hidenavigation=1&theme=dark
@vumaasha Hello, unfortunately it is not possible to change active month dynamically in current implementation. We use defaultDate
in data
stage, which is used only during component mount:
https://github.com/codesthq/vuelendar/blob/master/components/vl-calendar.vue#L65-L71
Would you like to create pull request to change it ? Seems like watcher on defaultDate
in vl-calendar
would be a good idea to go.
let me give it a try.
@lusarz do we need a watcher? defaultDate
is already in prop. we could move currentMonthMonth
and currentMonthYear
as computed fields. wouldn't that work?
I have some concerns - currentMonthMonth
and currentMonthYear
is used by left/right navigation arrows.
May be late to the party, but that's how i solved this issue, check this one
https://codesandbox.io/s/vuelendar-simple-day-selector-efez9?fontsize=14&hidenavigation=1&theme=dark
Thank you @f24aalam - this solution looks nice.