MpxRangeConverter rangeConverter=new MpxRangeConverter();
for (int i=0; i<7; i++) {
Day mpxDayId=Day.getInstance(i+1);
ProjectCalendarHours mpxDay=mpxCalendar.getCalendarHours(mpxDayId);
net.sf.mpxj.DayType mpxDayType=mpxCalendar.getWorkingDay(mpxDayId);
WorkDay day=null;
if (mpxDay == null) {
if (mpxCalendar.isDerived() &&
mpxBaseCalendar!=null &&
mpxBaseCalendar.isWorkingDay(mpxDayId))
day = WorkDay.getNonWorkingDay();
} else {
day=new WorkDay(DayType.getInstance(mpxDayType.getValue()));
rangeConverter.from(mpxDay,day);
}
week.setDay(i,day);
}