Some event selections
This commit is contained in:
@@ -793,25 +793,14 @@ public partial class CalendarPageViewModel : CalendarBaseViewModel,
|
||||
|
||||
// If the calendar item is not recurring, we can just return it.
|
||||
|
||||
if (calendarItemViewModel.ItemType == CalendarItemType.Timed) return new[] { calendarItemViewModel };
|
||||
if (calendarItemViewModel.ItemType == CalendarItemType.Timed || calendarItemViewModel.ItemType == CalendarItemType.RecurringException) return new[] { calendarItemViewModel };
|
||||
|
||||
|
||||
// TODO: Implement below logic.
|
||||
return default;
|
||||
|
||||
//if (!calendarItemViewModel.IsRecurringEvent)
|
||||
//{
|
||||
// return [calendarItemViewModel];
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// return DayRanges
|
||||
// .SelectMany(a => a.CalendarDays)
|
||||
// .Select(b => b.EventsCollection.GetCalendarItem(calendarItemViewModel.Id))
|
||||
// .Where(c => c != null)
|
||||
// .Cast<CalendarItemViewModel>()
|
||||
// .Distinct();
|
||||
//}
|
||||
return DayRanges
|
||||
.SelectMany(a => a.CalendarDays)
|
||||
.Select(b => b.EventsCollection.GetCalendarItem(calendarItemViewModel.Id))
|
||||
.Where(c => c != null)
|
||||
.Cast<CalendarItemViewModel>()
|
||||
.Distinct();
|
||||
}
|
||||
|
||||
private void UnselectCalendarItem(CalendarItemViewModel calendarItemViewModel, CalendarDayModel calendarDay = null)
|
||||
@@ -820,6 +809,8 @@ public partial class CalendarPageViewModel : CalendarBaseViewModel,
|
||||
|
||||
var itemsToUnselect = GetCalendarItems(calendarItemViewModel, calendarDay);
|
||||
|
||||
if (itemsToUnselect == null) return;
|
||||
|
||||
foreach (var item in itemsToUnselect)
|
||||
{
|
||||
item.IsSelected = false;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CalendarEventCollection
|
||||
// Multi-day events go to both.
|
||||
// Anything else goes to regular.
|
||||
|
||||
if (calendarItem.ItemType == Enums.CalendarItemType.AllDay)
|
||||
if (calendarItem.ItemType == Enums.CalendarItemType.AllDay || calendarItem.ItemType == Enums.CalendarItemType.MultiDayAllDay || calendarItem.ItemType == Enums.CalendarItemType.RecurringAllDay)
|
||||
{
|
||||
return [_internalAllDayEvents];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user