-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
🙋 Feature Request
I haven't found a way to set a minimum and maximum number of weeks per month. In some cases we need to have a calendar whose height does not change, to meet this need I would find it good to be able to define a minimum and maximum number of weeks that we wish to have in the month.
🤔 Expected Behavior
Have props that allow you to define the minimum number of weeks in a month and another field for the maximum value
😯 Current Behavior
The react-aria defines the weeks per month, the height of the calendar is not predictable and changes according to the months and the year selected
💁 Possible Solution
For technical solutions, I don't know how it works internally of the lib, sorry :/
🔦 Context
I have a time picker next to my calendar (custom implementation) which needs to be the same size as my calendar, I couldn't find in react aria/datepicker a way to tell my calendar to take 7 weeks for example.
So I had to do with js, observing the height of the calendar to define the height of my time picker, as the latter is not predictable, I have to adapt accordingly. The other problem this causes in my case is that visually it's not consistent with what we're currently doing, the time picker is getting bigger and the popup containing the calendar too, I think it's not specifically accepted by everyone.
I tried to play with the visibleDuration property but this does not impact the number of weeks in a month but just disables them which exceeds, in my case, I would like to say does not show less than 6 weeks and at most 6 weeks.
I think it would be really a big added value because it's the basic operation of the browser's datetime locale input type and also the only headless react library competing with yours, so there are real applications in the real world.
I'm afraid that for this little detail, I'll have to switch to the other headless and I'll be really annoyed
💻 Examples
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local => by default
https://github.com/rehookify/datepicker/tree/main => static mode