Displaying events and all-day events.

This commit is contained in:
Burak Kaan Köse
2024-12-28 23:17:16 +01:00
parent 95b8f54b27
commit 979a3d8f1f
17 changed files with 195 additions and 31 deletions

View File

@@ -0,0 +1,29 @@
using System.Collections.ObjectModel;
using Wino.Core.Domain.Interfaces;
namespace Wino.Core.Domain.Collections
{
public class CalendarEventCollection : ObservableRangeCollection<ICalendarItem>
{
public ObservableCollection<ICalendarItem> AllDayEvents { get; } = new ObservableCollection<ICalendarItem>();
public new void Add(ICalendarItem calendarItem)
{
base.Add(calendarItem);
if (calendarItem.Period.Duration.TotalMinutes == 1440)
{
AllDayEvents.Add(calendarItem);
}
}
public new void Remove(ICalendarItem calendarItem)
{
base.Remove(calendarItem);
if (calendarItem.Period.Duration.TotalMinutes == 1440)
{
AllDayEvents.Remove(calendarItem);
}
}
}
}

View File

@@ -8,6 +8,8 @@
public const string WinoLocalDraftHeader = "X-Wino-Draft-Id";
public const string LocalDraftStartPrefix = "localDraft_";
public const string CalendarEventRecurrenceRuleSeperator = "___";
public const string ToastMailUniqueIdKey = nameof(ToastMailUniqueIdKey);
public const string ToastActionKey = nameof(ToastActionKey);

View File

@@ -14,5 +14,6 @@ namespace Wino.Core.Domain.Interfaces
Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
Task CreateNewCalendarItemAsync(CalendarItem calendarItem, List<CalendarEventAttendee> attendees);
Task<List<ICalendarItem>> GetCalendarEventsAsync(Guid calendarId, DateTime rangeStart, DateTime rangeEnd);
}
}

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.ObjectModel;
using Itenso.TimePeriod;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Collections;
namespace Wino.Core.Domain.Models.Calendar
{
@@ -12,7 +11,7 @@ namespace Wino.Core.Domain.Models.Calendar
public class CalendarDayModel
{
public TimeRange Period { get; }
public ObservableCollection<ICalendarItem> Events { get; } = new ObservableCollection<ICalendarItem>();
public CalendarEventCollection EventsCollection { get; } = new CalendarEventCollection();
public CalendarDayModel(DateTime representingDate, CalendarRenderOptions calendarRenderOptions)
{
RepresentingDate = representingDate;