After booking an appointment (Adding a calendar item) at 23:00 (last cell of the day, using only DayView) and going to the next day there seems to throw an error
I suspect the fact that adding 1 hour to the CalendarItem from 23:00 to 00:00 the next day at 00:00 is not properly displayed and it throws the error due to having no value
Using .AddHours(1.1) instead of .AddHours(1) fixes the issue, Start & End date times when booking at 23:00 with AddHours(1.1) output:
5/15/2024 11:00:00 PM - 5/16/2024 12:06:00 AM
blazor.web.js:1 [2024-05-15T16:33:52.772Z] Error: System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.MaxInteger[TSource,TResult](IEnumerable`1 source, Func`2 selector)
at Heron.MudCalendar.DayWeekViewBase.CalcPositions(IEnumerable`1 items, DateOnly date)
at Heron.MudCalendar.DayWeekViewBase.<>c__DisplayClass44_0.<RenderCellContents>b__0(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Heron.MudCalendar.DayWeekViewBase.<>c__DisplayClass43_0.<RenderCell>b__0(RenderTreeBuilder __builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Heron.MudCalendar.DayWeekViewBase.<get_RenderCells>b__42_0(RenderTreeBuilder __builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Heron.MudCalendar.DayWeekViewBase.<get_Render>b__35_4(RenderTreeBuilder __builder3)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at MudBlazor.MudDropContainer`1.<BuildRenderTree>b__94_0(RenderTreeBuilder __builder2)
at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
_calendarAppointments.Add(new CalendarItem
{
Start = dateTime,
End = dateTime.AddHours(1),
Text = "Booked"
});
Start & End date times output when booking at 23:00:
5/15/2024 11:00:00 PM - 5/16/2024 12:00:00 AM
Another bug that I've encountered only happening at 12:00 to 13:00 date times, unfortunately I haven't had the time to look into it to provide at least some context of where the issue is coming from
Later edit: the visual bug was fixed by increasing DayCellHeight from 36 (default) to 40
After booking an appointment (Adding a calendar item) at 23:00 (last cell of the day, using only DayView) and going to the next day there seems to throw an error I suspect the fact that adding 1 hour to the CalendarItem from 23:00 to 00:00 the next day at 00:00 is not properly displayed and it throws the error due to having no value
Using .AddHours(1.1) instead of .AddHours(1) fixes the issue, Start & End date times when booking at 23:00 with AddHours(1.1) output:
5/15/2024 11:00:00 PM - 5/16/2024 12:06:00 AM
My calendar code for reproducibility purposes:
OnCellClicked code:
Start & End date times output when booking at 23:00:
5/15/2024 11:00:00 PM - 5/16/2024 12:00:00 AM
Another bug that I've encountered only happening at 12:00 to 13:00 date times, unfortunately I haven't had the time to look into it to provide at least some context of where the issue is coming from
Later edit: the visual bug was fixed by increasing DayCellHeight from 36 (default) to 40