calendar.setTimeInMillis(first);
sdCalendar.setFlaggedDates(null);
sdCalendar.setColorDates(null);
DayDescriptor day;
ArrayList flaggedDates=new ArrayList();
ArrayList colorDates=new ArrayList();
while(calendar.getTimeInMillis()<=last){
day=service.getDay(wc,calendar.getTimeInMillis());
if (day.isModified())
flaggedDates.add(new Long(calendar.getTimeInMillis()));
if (!day.isWorking())
colorDates.add(new Long(calendar.getTimeInMillis()));
calendar.add(Calendar.DATE,1);
}
if (flaggedDates.size()>0)
sdCalendar.setFlaggedDates(toLongArray(flaggedDates));
if (colorDates.size()>0)
sdCalendar.setColorDates(toLongArray(colorDates));
boolean colorWeekDates[] = new boolean[7];
boolean flaggedWeekDates[] = new boolean[7];
for (int i =0; i < 7; i++) {
day = service.getWeekDay(wc,i+1);
if (day.isModified())
flaggedWeekDates[i] = true;
if (!day.isWorking())
colorWeekDates[i] = true;
}
sdCalendar.setColorWeekDates(colorWeekDates);
sdCalendar.setFlaggedWeekDates(flaggedWeekDates);
// updateWorkingHours();