Fix desktop calendar week grouping to properly start weeks on Monday and end on Sunday
Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com>
This commit is contained in:
parent
0a004de8e2
commit
9d17bb056d
1 changed files with 3 additions and 3 deletions
|
|
@ -322,7 +322,7 @@ namespace ShiftScheduler.Client.Pages
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper method to group days by week for desktop calendar view
|
// Helper method to group days by week for desktop calendar view
|
||||||
// Each week starts with Monday and ends with Sunday (max 7 days per row)
|
// Each week starts with Monday and ends with Sunday
|
||||||
private List<List<DateTime>> GetWeeksInMonth()
|
private List<List<DateTime>> GetWeeksInMonth()
|
||||||
{
|
{
|
||||||
var days = SelectedDate.DaysInMonth();
|
var days = SelectedDate.DaysInMonth();
|
||||||
|
|
@ -334,8 +334,8 @@ namespace ShiftScheduler.Client.Pages
|
||||||
// Add the day to current week
|
// Add the day to current week
|
||||||
currentWeek.Add(day);
|
currentWeek.Add(day);
|
||||||
|
|
||||||
// If it's Sunday or we have 7 days, end the week
|
// End the week when it's Sunday
|
||||||
if (day.DayOfWeek == DayOfWeek.Sunday || currentWeek.Count == 7)
|
if (day.DayOfWeek == DayOfWeek.Sunday)
|
||||||
{
|
{
|
||||||
weeks.Add(currentWeek);
|
weeks.Add(currentWeek);
|
||||||
currentWeek = new List<DateTime>();
|
currentWeek = new List<DateTime>();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue