code: private void readExceptionDay(ProjectCalendar calendar, Project.Calendars.Calendar.WeekDays.WeekDay day)
     {
        Project.Calendars.Calendar.WeekDays.WeekDay.TimePeriod timePeriod = day.getTimePeriod();
        Date fromDate = timePeriod.getFromDate();
        Date toDate = timePeriod.getToDate();
        Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes times = day.getWorkingTimes();
        ProjectCalendarException exception = calendar.addCalendarException(fromDate, toDate);
  
        if (times != null)
        {
           List<Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes.WorkingTime> time = times.getWorkingTime();
           for (Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes.WorkingTime period : time)
           {
              Date startTime = period.getFromTime();
              Date endTime = period.getToTime();
  
              if (startTime != null && endTime != null)
              {
                 if (startTime.getTime() >= endTime.getTime())
                 {
                    endTime = DateHelper.addDays(endTime, 1);
                 }
  
                 exception.addRange(new DateRange(startTime, endTime));
              }
           }
        }
     }
docs: This method extracts data for an exception day from an MSPDI file.
  
  @param calendar Calendar data
  @param day Day data