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)
|
foreach (var day in days)
|
||||||
{
|
{
|
||||||
// Add the day to current week
|
// Start a new week if this is Monday and we have days in current week
|
||||||
currentWeek.Add(day);
|
if (day.DayOfWeek == DayOfWeek.Monday && currentWeek.Count > 0)
|
||||||
|
|
||||||
// End the week when it's Sunday
|
|
||||||
if (day.DayOfWeek == DayOfWeek.Sunday)
|
|
||||||
{
|
{
|
||||||
weeks.Add(currentWeek);
|
weeks.Add(currentWeek);
|
||||||
currentWeek = new List<DateTime>();
|
currentWeek = new List<DateTime>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the day to current week
|
||||||
|
currentWeek.Add(day);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add any remaining days as the last week
|
// Add any remaining days as the last week
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue