Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically chaining the month as we open the calendar. #280

Open
krishdev opened this issue Nov 16, 2021 · 4 comments
Open

Programmatically chaining the month as we open the calendar. #280

krishdev opened this issue Nov 16, 2021 · 4 comments

Comments

@krishdev
Copy link

Is there a way to open up the calendar without default dates and go to a desired month?

For instance: Current month is November 2021, If I had to open up the calendar with the month and year set to January 2022 and let the user directly pick a date from Jan instead of letting them do it.

Any help or future enhancements is greatly appreciated.

@nkostadinov
Copy link
Contributor

You can actually do this in the current version. You need to set a ref to the datepicker component and then after open (@toggle event) you can write something like:

this.$refs.picker.changeLeftMonth({ year: 2021, month: 1 })

I havent tested it, but you can try and say if it works.

@nguyenduc308
Copy link

@nkostadinov I have tried it, not worked for me

@nguyenduc308
Copy link

Now it's working, i wrap it in settimeout for waiting the 'watch.open' is triggered

@timmaybrown
Copy link

i had to wrap this in a

this.$nextTick(() => { //...changeLeftMonth() stuff here }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants