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:
parent
d157a0743a
commit
97e3d1b490
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue