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

Add option to specify dates with special styling #181

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ubhaller
Copy link

This pull request allows passing a list of dates to the date select, which will then be styled according to the calendar style sheet in the render config.

@mikaelmello
Copy link
Owner

First of all thanks for the contribution. This feature (stylizing dates) is something that should have happened a long time ago lol.

One mile I'd like to go further is instead of having a static style for all marked_dates, I think a more powerful feature would be to allow different dates to be marked with different styles.

A scenario that often comes to mind is something like dates being colored according to some availability measure, like "red" dates are unavailable for whatever the prompt is, green would be the best pick, etc.

  1. What if marked_dates were to be a HashMap<NaiveDate, Stylesheet> instead?
  2. For scenarios where the date ranges are too extensive (e.g. in a flight planner you often look months ahead), it becomes annoying having to fill like hundreds of days in this list/map in advance. What if this were a callback to be called upon rendering? Haven't thought too deeply about the trade-offs but seems like it's worth considering.
  3. We expanding this feature to cover different styles, I think the marked adjetive could be replaced by something a little bit more broad, that conveys the purpose of the variable (like convey information about the date via its style). I haven't thought of anything better than marked yet but I feel like it could convey more about what this feature makes possible you know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants