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

Request for goToNextYear, goToPreviousYear #3

Closed
moogriento opened this issue Jul 30, 2019 · 5 comments
Closed

Request for goToNextYear, goToPreviousYear #3

moogriento opened this issue Jul 30, 2019 · 5 comments

Comments

@moogriento
Copy link

moogriento commented Jul 30, 2019

Hello, is it possible to add the following two methods?

  • goToNextYear
  • goToPreviousYear

in the useDatepicker hook? It would work just like goToNextMonths / goToPreviousMonths but moving between years.

Thanks

@tresko tresko closed this as completed Jul 30, 2019
@tresko tresko reopened this Jul 30, 2019
@tresko
Copy link
Collaborator

tresko commented Jul 30, 2019

Of course, I will add it within 3 days.

@tresko
Copy link
Collaborator

tresko commented Aug 1, 2019

I included those methods in 1.7.0 release.

@tresko tresko closed this as completed Aug 1, 2019
@moogriento
Copy link
Author

Hello, awesome work and thanks for the changes :). It works perfect with numberOfMonths: 2

https://codesandbox.io/s/react-example-wqhbd

However if numberOfMonths is set to 1, it takes a weird behaviour

  • From August 2019 -> goToPrevYear turns into September 2019 (instead of August 2018).
  • From August 2019 -> goToNextYear turns into July 2020 (instead of August 2020)

This is a working example explaining that case:
https://codesandbox.io/s/react-example-bqsc5

Is there anything there that can be done? Thanks

@tresko tresko reopened this Aug 2, 2019
@tresko tresko closed this as completed in 86577e5 Aug 2, 2019
@tresko
Copy link
Collaborator

tresko commented Aug 2, 2019

Thank you. Sorry for this bug. I fixed it in version 1.7.1.

You can check it here: https://codesandbox.io/s/react-example-qz8p1

If you want to contribute or have some ideas you can write to me at twitter (https://twitter.com/tresko9) or email me (sedej.miha@gmail.com).

Kind regards,

Miha

@moogriento
Copy link
Author

Works perfect. Thanks!

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

2 participants