Skip to content

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’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.

@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...) 😅

@davide-pi
Copy link
Author

Good morning @patriksvensson, can you find some time to check this PR?
Along with #1244 and #1245?

Thanks in advance

Copy link
Contributor

@patriksvensson patriksvensson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@patriksvensson patriksvensson merged commit 3437130 into spectreconsole:main Sep 9, 2024
@davide-pi davide-pi deleted the feature/add-custom-style-calendar-events branch September 9, 2024 18:40
@SeppPenner
Copy link

Do we have a guess when the next version will be available?

@patriksvensson
Copy link
Contributor

No, not yet. You can use the preview version until it's been released.

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.

4 participants