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

Weekday selection? #459

Closed
rubjo opened this issue Dec 9, 2021 · 6 comments
Closed

Weekday selection? #459

rubjo opened this issue Dec 9, 2021 · 6 comments

Comments

@rubjo
Copy link

rubjo commented Dec 9, 2021

Hi,

And thanks for making and updating this very nice picker!

Would you consider adding the possibility of selecting weekdays for multiple dates mode? This would be a little different than collecting an array of dates, as it would just entail toggling seven Booleans by clicking on weekday headings and indicating it with CSS.

@t1m0n
Copy link
Owner

t1m0n commented Jan 31, 2022

Hello! Thanks for your response and sorry for the long answer.
I don't quite understand what you mean - you want to be able to choose for example all Tuesdays when clicking on day name in calendar body?

@rubjo
Copy link
Author

rubjo commented Jan 31, 2022

Yes, eg. all Saturdays and Sundays.

My use case for this is like so: A library needs to indicate what days are «red», ie. what days the library is closed and shouldn’t use for due dates for books etc. on. Typically, this would be weekends (esp. Sundays), national holidays and a handful other dates.

So to set this, it would be nice to use air-datepicker with multipledates and some option to allow weekday selection, so that the output from the picker could be (pseudo code):

{
dates: [date X, date Y…],
weekdays: [6, 7] // Saturdays & Sundays
}

Hope this makes sense. I already patched together this functionality for air-datepicker v2 myself, but it would be nice to have it in v3 as well, as I’d rather want to use that. :)

@t1m0n
Copy link
Owner

t1m0n commented Feb 15, 2022

Hm, it seems to me adding onClick event on day names should resolve this issue?

@rubjo
Copy link
Author

rubjo commented Feb 15, 2022

Well, yes, to resolve it, one should have a listener and then of course some styles to indicate which weekdays are selected.

So the issue is about having this functionality built into the library (because it could be useful to others as well), but yes, I could probably just implement it myself.

@t1m0n t1m0n added this to the v3.2.0 milestone Feb 17, 2022
@rubjo
Copy link
Author

rubjo commented Mar 3, 2022

Thanks for including this feature in the next milestone. Let me know if you need some help with it or a pull request.

And I would like to send all my very best wishes to you in what is and will be a difficult time for the people of your country, because of the actions of a few selfish men at the top. ❤️🇷🇺🕊🇺🇦❤️

@t1m0n
Copy link
Owner

t1m0n commented Mar 3, 2022

Thank you for your support and kind words! 🙏Nobody wants this bloody war, I hope this horror will end up soon.

@t1m0n t1m0n closed this as completed Mar 27, 2022
pleomax13 pushed a commit to pleomax13/air-datepicker that referenced this issue Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants