inquire
inquire copied to clipboard
Add option to specify dates with special styling
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.
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.
- What if
marked_dateswere to be aHashMap<NaiveDate, Stylesheet>instead? - 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.
- We expanding this feature to cover different styles, I think the
markedadjetive 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?