spectre.console
spectre.console copied to clipboard
Add custom style for each calendar event
Description
Implemented the custom highlight style for single calendar event. Also requested with issue #1234.
Example
As shown below the calendar now support the default highlight style 2023-06-22 but also support different style for different events like 2023-06-24 and 2023-06-25 in yellow foreground and 2023-06-27 with red foreground
To Test
To test this implementation is sufficient to put it into the Main method of the Program.cs in the Spectre.Console.Analyzer.Sandbox .
var today = DateTime.Today;
var calendar = new Calendar(today.Year, today.Month);
//Just keep an eye on the current day
calendar.AddCalendarEvent(today);
//Interesting events
calendar.AddCalendarEvent(today.AddDays(2), Color.Yellow);
calendar.AddCalendarEvent(today.AddDays(3), Color.Yellow);
//Inderogable important event
calendar.AddCalendarEvent(today.AddDays(5), Color.Red);
AnsiConsole.Write(calendar);
Hi @patriksvensson, I'm sorry, but I'm new to GitHub contributions. I've noticed that no reviewers are automatically added to my PRs, and I haven't found a way to add myself either. I just wanted to notify you about my following 3 PRs:
- #1246 (this one)
- #1245
- #1244
I apologize if this is not the correct way, or if you have already been notified about these 3 PRs and you will be checking them in the future.
I just wanted to make sure to bring them to your attention. Thank you.
@davide-pi Hello, yes we do not automatically assign reviewers to PRs. We do things as we have time. Right now we’re all on summer vacation so work on this project will be at a minimum. We work on this project in our spare time and we all have jobs and families so there isn’t really an SLA.
Someone will get around to reviewing this at some point. I will try to set aside some time next week.
Thanks for explaining. I will wait for a review when someone of you has time. Thanks again.
I haven't seen this pull request and therefore created https://github.com/spectreconsole/spectre.console/pull/1254... :D
The benefit of this here is that there's still the option to specify a default highlight color for the whole calendar while mine doesn't allow that (In my case that was ok, as I don't need the option either way).
This one would be really nice and I guess is neither breaking nor difficult to verify that it works...
@patriksvensson Can we get this into the next release, please? (At the moment, I maintain a custom fork of the project to use the feature...) 😅