mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
19 lines
689 B
C#
19 lines
689 B
C#
namespace ChrisKaczor.HomeMonitor.Calendar.Service.Models;
|
|
|
|
public class HolidayEntry
|
|
{
|
|
public string Name { get; set; }
|
|
public DateTimeOffset Date { get; set; }
|
|
public string Type { 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));
|
|
Type = "public";
|
|
IsToday = Date.Date == DateTimeOffset.UtcNow.Date;
|
|
DurationUntil = new Duration(Date);
|
|
}
|
|
} |