uselessdev / datepicker

A simple datepicker with Chakra-UI and date-fns

Home Page:https://uselessdev-datepicker.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skipping years

kennym opened this issue · comments

First of all, great and well-written package!

I wonder if it's possible to skip years, not only months. It's a requirement I have for my app, and wonder if this needs to be added or could be easily customized?

Hi, @kennym thanks,

I wonder if it's possible to skip years, not only months. It's a requirement I have for my app, and wonder if this needs to be added or could be easily customized?

Yes, I'm working on the next release that allows us to easily do this, but at this moment there's no way to customize this sadly.

@uselessdev I implemented something very quickly with #64 ... this will do for now for my project. Let me know if this is totally different from what you had in mind for an implementation.

Hi @kennym sorry for the late reply, I publish an alpha release for v3.0.0 it's possible to test if it works for you?

You can see an example of how this should work here:

https://github.com/uselessdev/datepicker/blob/next/stories/calendar.stories.tsx#L24-L45

and as you can see here the useCalendar export onNextYear and onPrevYear so by this you can add a custom button to handle with this.

@uselessdev I've done the very same thing in my PR 😃

commented

Hi @kennym sorry for the late reply, I publish an alpha release for v3.0.0 it's possible to test if it works for you?

You can see an example of how this should work here:

https://github.com/uselessdev/datepicker/blob/next/stories/calendar.stories.tsx#L24-L45

and as you can see here the useCalendar export onNextYear and onPrevYear so by this you can add a custom button to handle with this.

How to fix this error ? Im using Next JS and React 18
image

I'm not sure @joycenn

commented

Is it working on your end ?

Yes, but I'll investigate it to make sure

Hi @joycenn I've made some tests and there's a bug, but I think it's solved in the v3.0.0-alpha.2 unfortunately there is another bug in the theme, and I'm working on this one.

Update: Sorry @joycenn but the v3.0.0-alpha.2 still has the same bug, this is fixed in the v3.0.0-alpha.3 (I hope) now I'll close this issue, if you still have problems please let me know.