if (odt != null)
{
List<Interval> intervalList = odt.getInterval();
if (intervalList != null)
{
ProjectCalendarHours mondayHours = null;
ProjectCalendarHours tuesdayHours = null;
ProjectCalendarHours wednesdayHours = null;
ProjectCalendarHours thursdayHours = null;
ProjectCalendarHours fridayHours = null;
ProjectCalendarHours saturdayHours = null;
ProjectCalendarHours sundayHours = null;
if (mpxjCalendar.isWorkingDay(Day.MONDAY))
{
mondayHours = mpxjCalendar.addCalendarHours(Day.MONDAY);
}
if (mpxjCalendar.isWorkingDay(Day.TUESDAY))
{
tuesdayHours = mpxjCalendar.addCalendarHours(Day.TUESDAY);
}
if (mpxjCalendar.isWorkingDay(Day.WEDNESDAY))
{
wednesdayHours = mpxjCalendar.addCalendarHours(Day.WEDNESDAY);
}
if (mpxjCalendar.isWorkingDay(Day.THURSDAY))
{
thursdayHours = mpxjCalendar.addCalendarHours(Day.THURSDAY);
}
if (mpxjCalendar.isWorkingDay(Day.FRIDAY))
{
fridayHours = mpxjCalendar.addCalendarHours(Day.FRIDAY);
}
if (mpxjCalendar.isWorkingDay(Day.SATURDAY))
{
saturdayHours = mpxjCalendar.addCalendarHours(Day.SATURDAY);
}
if (mpxjCalendar.isWorkingDay(Day.SUNDAY))
{
sundayHours = mpxjCalendar.addCalendarHours(Day.SUNDAY);
}
for (Interval interval : intervalList)
{
Date startTime = getTime(interval.getStart());
Date endTime = getTime(interval.getEnd());
m_defaultWorkingHours.add(new DateRange(startTime, endTime));
if (mondayHours != null)
{
mondayHours.addRange(new DateRange(startTime, endTime));
}
if (tuesdayHours != null)
{
tuesdayHours.addRange(new DateRange(startTime, endTime));
}
if (wednesdayHours != null)
{
wednesdayHours.addRange(new DateRange(startTime, endTime));
}
if (thursdayHours != null)
{
thursdayHours.addRange(new DateRange(startTime, endTime));
}
if (fridayHours != null)
{
fridayHours.addRange(new DateRange(startTime, endTime));
}
if (saturdayHours != null)
{
saturdayHours.addRange(new DateRange(startTime, endTime));
}
if (sundayHours != null)
{
sundayHours.addRange(new DateRange(startTime, endTime));
}
}
}
}
}