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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom style for each calendar event #1246

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

Conversation

davide-pi
Copy link

@davide-pi davide-pi commented Jun 22, 2023

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

image

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);

Please upvote 馃憤 this pull request if you are interested in it.

@davide-pi
Copy link
Author

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:

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.

@patriksvensson
Copy link
Contributor

@davide-pi Hello, yes we do not automatically assign reviewers to PRs. We do things as we have time. Right now we鈥檙e 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鈥檛 really an SLA.

Someone will get around to reviewing this at some point. I will try to set aside some time next week.

@davide-pi
Copy link
Author

Thanks for explaining. I will wait for a review when someone of you has time. Thanks again.

@SeppPenner
Copy link

I haven't seen this pull request and therefore created #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).

@SeppPenner
Copy link

This one would be really nice and I guess is neither breaking nor difficult to verify that it works...

@SeppPenner
Copy link

@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...) 馃槄

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

Successfully merging this pull request may close these issues.

None yet

3 participants