Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.43k stars 142 forks source link

The current month should be second but not the first month in the multi-calendar #833

Closed EugenGedroyc closed 4 months ago

EugenGedroyc commented 4 months ago

Is your feature request related to a problem? Please describe. I need to select days in the previous month in multi-calendar, because it has no any data after the current day. Therefore next month is disable always. image

Describe the solution you'd like Add prop that shifts the months in the multi-calendar: image

EugenGedroyc commented 4 months ago

Or just call the 'prev' event on the arrow-button after opening Multi-calendar?

decoded-cipher commented 4 months ago

Thanks to @EugenGedroyc for this issue. Infact, right now I was surfing through the documentation to check if there was any other way to get this done.

EugenGedroyc commented 4 months ago

to check if there was any other way to get this done.

I even asked various LLMs and "the best answer" was: :start-date="new Date(new Date().setMonth(new Date().getMonth() - 1))" But not work for me.

decoded-cipher commented 4 months ago

to check if there was any other way to get this done.

I even asked various LLMs and "the best answer" was: :start-date="new Date(new Date().setMonth(new Date().getMonth() - 1))" But not work for me.

Me too 🤣

Jasenkoo commented 4 months ago

Hello @EugenGedroyc @decoded-cipher , not sure why

I even asked various LLMs and "the best answer" was: :start-date="new Date(new Date().setMonth(new Date().getMonth() - 1))" But not work for me.

didn't work, however, here is the playground example that achieves what you are trying to do.

EugenGedroyc commented 4 months ago

@Jasenkoo thanks for the good example, but with range doesn't work

Jasenkoo commented 4 months ago

@EugenGedroyc This is because you are providing a v-model which is not empty, to force the start date you need focus-start-date prop enabled

EugenGedroyc commented 4 months ago

:start-date="new Date(new Date().setMonth(new Date().getMonth() - 1))" But not work for me.

Works with focus-start-date Turns out that's the only property missing in my case. @Jasenkoo thank you very much!

decoded-cipher commented 4 months ago

Mine too... Thanks @EugenGedroyc