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

Change year #35

Closed
johinsDev opened this issue Nov 18, 2019 · 6 comments
Closed

Change year #35

johinsDev opened this issue Nov 18, 2019 · 6 comments

Comments

@johinsDev
Copy link

I change year programmatically or with a method of useDatepicker?

@johinsDev
Copy link
Author

johinsDev commented Nov 19, 2019

I think that with a simple change i can controlled the number of years and for example i would create a select of years:

 function goToPreviousYear(numYears = 1) {
    setActiveMonths(
      getNextActiveMonth(
        activeMonths,
        numberOfMonths,
        -(numYears * 12 - numberOfMonths + 1)
      )
    );
    setFocusedDate(null);
  }

  function goToNextYear(numYears = 1) {
    setActiveMonths(
      getNextActiveMonth(
        activeMonths,
        numberOfMonths,
        numYears * 12 - numberOfMonths + 1
      )
    );
    setFocusedDate(null);
  }

WDYT? 🤔 @tresko

@tresko
Copy link
Collaborator

tresko commented Nov 19, 2019

Would you create a pull request? It seems fine to me.

@johinsDev
Copy link
Author

Would you create a pull request? It seems fine to me.

Yes off course

@goxr3plus
Copy link

@johinsDev Waiting for it :)

@tresko
Copy link
Collaborator

tresko commented Dec 5, 2019

I will do it today or tomorrow.

@tresko tresko closed this as completed in 15ac2b6 Dec 6, 2019
@tresko
Copy link
Collaborator

tresko commented Dec 6, 2019

Included in v2.2.

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

3 participants