Replace calendar service with new .NET version

This commit is contained in:
2024-12-18 11:59:05 -05:00
parent 4dbedee94b
commit 40ebbf38cb
25 changed files with 767 additions and 3504 deletions

View File

@@ -0,0 +1,17 @@
namespace ChrisKaczor.HomeMonitor.Calendar.Service.Models;
public class HolidayEntry
{
public string Name { get; set; }
public DateTimeOffset Date { get; set; }
public bool IsToday { get; set; }
public Duration DurationUntil { get; set; }
public HolidayEntry(CalendarEntry calendarEntry, TimeZoneInfo timeZoneInfo)
{
Name = calendarEntry.Summary;
Date = TimeZoneInfo.ConvertTime(calendarEntry.Start, timeZoneInfo).Subtract(timeZoneInfo.GetUtcOffset(calendarEntry.Start));
IsToday = Date.Date == DateTimeOffset.UtcNow.Date;
DurationUntil = new Duration(Date);
}
}