Fix desktop week grouping to start weeks on Monday instead of grouping consecutive days

Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-29 17:43:57 +00:00
parent d157a0743a
commit 97e3d1b490

View file

@ -331,15 +331,15 @@ namespace ShiftScheduler.Client.Pages
foreach (var day in days)
{
// Add the day to current week
currentWeek.Add(day);
// End the week when it's Sunday
if (day.DayOfWeek == DayOfWeek.Sunday)
// Start a new week if this is Monday and we have days in current week
if (day.DayOfWeek == DayOfWeek.Monday && currentWeek.Count > 0)
{
weeks.Add(currentWeek);
currentWeek = new List<DateTime>();
}
// Add the day to current week
currentWeek.Add(day);
}
// Add any remaining days as the last week