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] Optional valid values list attribute for DatePicker #8917

Closed
zdgriffith opened this issue May 14, 2019 · 2 comments · Fixed by #9509
Closed

[FEATURE] Optional valid values list attribute for DatePicker #8917

zdgriffith opened this issue May 14, 2019 · 2 comments · Fixed by #9509

Comments

@zdgriffith
Copy link
Contributor

@zdgriffith zdgriffith commented May 14, 2019

It would be nice to be able to give the DatePicker widget a list of valid dates, such that within the minimum and maximum date range only the dates in the list are able to be selected. Ideally this would also grey out the invalid dates just like dates outside the range given are marked now (example below).

image

I'd imagine this involves the JavaScript/TypeScript side of things which I have no experience in, but if someone in the know thinks this is would be a smaller job and could point me in the right direction I'd be happy to take a crack at it.

@bryevdv
Copy link
Member

@bryevdv bryevdv commented Jun 11, 2019

Looks like pikaday has a disableDayFn which requires passing a JS function to return true/false for every day in the view to specify if it is selectable:

https://github.com/Pikaday/Pikaday

That's not really ideal but also not impossible to work with.

@bryevdv
Copy link
Member

@bryevdv bryevdv commented Jan 17, 2020

#9509 fixes this and many other datepicker issues (as well as adds selenium tests) for 2.0 but note that the implementaton was switched to Flatpickr, and also now date values can only be expressed as ISO date strings, or datetime.date and nothing else (in particular no more datetime values which caused endless trouble with time zones)

@bryevdv bryevdv mentioned this issue Jan 17, 2020
5 tasks
@bryevdv bryevdv removed this from the short-term milestone Jan 17, 2020
@bryevdv bryevdv added this to the 2.0 milestone Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants