aboveyunhai / chakra-dayzed-datepicker

Chakra UI + Dayzed = datepicker
https://aboveyunhai.github.io/chakra-dayzed-datepicker/
MIT License
222 stars 46 forks source link

Is it possible to show the selected date when below minDate? #76

Closed namolnad closed 3 months ago

namolnad commented 3 months ago

Hi there,

I'd like to allow users to see what the selected date is, even if it is disabled and earlier than the minDate. I don't seem to be able to make this work so far, as the selected date doesn't show the "selected" bg color, and just appears transparent like the other disabled dates. Is this possible via a workaround, or would it be possible to add this functionality?

aboveyunhai commented 3 months ago

https://github.com/aboveyunhai/chakra-dayzed-datepicker/blob/c5370546d5f2ae3341a1d9bf4b5143e0f5c1790f/src/components/dayOfMonth.tsx#L90-L93

it seems like currently there is no workaround based on the code. see how the disabled rejected the selected style. Maybe create a PR to see what kinds of styles override you imagine to have, the order is really important here. Also note that, the codebase github have right now is one major version ahead of the npm as it tried to fix the past issue and have quite some breaking changes check the latest version looks like here (input-> input with icon trigger, the default v0.2 input without trigger -> button as the v0.2 is semantically incorrect and troublesome).

Or the best way I recommend from the doc, copy/paste the src folder into your project and do whatever you want, as it's not that complex tbh.

namolnad commented 3 months ago

Thanks for the response, @aboveyunhai! I'll give this some thought and may follow up with a proposal if I can get something going that feels like it makes sense and may be more generally applicable. :)