public static WeekWithoutProgressDto GetNullWeek() { WeekWithoutProgressDto nullWeek = new WeekWithoutProgressDto(); nullWeek.Id = -1; nullWeek.Number = 0; nullWeek.MondayDate = DateTime.Now; if (nullWeek.MondayDate.DayOfWeek != DayOfWeek.Monday) { var offset = (int)DayOfWeek.Monday - (int)nullWeek.MondayDate.DayOfWeek; //following two lines could be combined. var monday = nullWeek.MondayDate + TimeSpan.FromDays(offset); nullWeek.MondayDate = monday; } nullWeek.DayCount = 5; return(nullWeek); }
public WeekForCreationDto(WeekWithoutProgressDto previousWeek) { Number = previousWeek.Number + 1; MondayDate = previousWeek.MondayDate.AddDays(7); DayCount = 5; //TODO: method to get day count based on recognized holidays. upload school calendar? Hah! }