inquire icon indicating copy to clipboard operation
inquire copied to clipboard

Add option to specify dates with special styling

Open ubhaller opened this issue 2 years ago • 1 comments

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.

ubhaller avatar Sep 22 '23 10:09 ubhaller

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?

mikaelmello avatar Sep 30 '23 22:09 mikaelmello