DateMidnight firstDayInMonth = date.monthOfYear().roundFloorCopy();
DateMidnight lastDayInMonth = firstDayInMonth.plusMonths(1);
for (DateMidnight currentWeek = firstDayInMonth; currentWeek.isBefore(lastDayInMonth);
currentWeek = currentWeek.plusWeeks(1))
{
Week week = new Week(currentWeek.getYear(), currentWeek.getWeekOfWeekyear());
weeks.add(week);
DateMidnight startOfWeek = currentWeek.weekOfWeekyear().roundFloorCopy();
DateMidnight endOfWeek = startOfWeek.plusWeeks(1);
for (DateMidnight currentDate = startOfWeek; currentDate.isBefore(endOfWeek);
currentDate = currentDate.plusDays(1))
{
Day day = new Day(currentDate.getYear(), currentDate.getMonthOfYear(), currentDate.getDayOfMonth());
week.add(day);
for (Activity activity : activities)
{
Time start = activity.getStart();
if (currentDate.equals(start.toDateMidnight()) && date.getMonthOfYear() == start.getMonth())
{