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

Feature: Date picker: Allow only some dates #936

Open
Sleepful opened this issue Jul 26, 2024 · 2 comments
Open

Feature: Date picker: Allow only some dates #936

Sleepful opened this issue Jul 26, 2024 · 2 comments

Comments

@Sleepful
Copy link

Sleepful commented Jul 26, 2024

Lets say I have an event scheduling app for corporate meetings. I want the Manager user to indicate which days of the week they are available for a meeting, then I want to show the DatePicker to the Employee user with only those days available as inputs.

This is similar to min/max date: #417

The difference is that the range of available dates might not be a continuous segment of days in a row.

You may imagine something similar to Calendly scheduling calendar:

https://calendly.com

I know that the min/max dates are passed to the component as HTML data attributes.

However, this feature might be better served by JS API. I am uncertain about the specific implementation that would be better, but also I have no preference

@Sleepful
Copy link
Author

Looks like this is already supported behavior by the underlying library, it just needs to be added to the flowbite docs/interface type:

themesberg/flowbite-datepicker#30 (comment)

@Sleepful
Copy link
Author

This code:

https://github.com/themesberg/flowbite/blob/main/src/components/datepicker/index.ts#L143-L184

makes it such that only "allowed" options can be passed down to the underlying component, walling-off the ones that aren't explicitly documented (but still available).
Would be nice to just pass the entire _options object and give full access to the underlying https://github.com/mymth/vanillajs-datepicker options.

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

1 participant