code: private void addCalendarExceptions(Table table, ProjectCalendar calendar, Integer exceptionID)
     {
        Integer currentExceptionID = exceptionID;
        while (true)
        {
           MapRow row = table.find(currentExceptionID);
           if (row == null)
           {
              break;
           }
  
           Date date = row.getDate("DATE");
           ProjectCalendarException exception = calendar.addCalendarException(date, date);
           if (row.getBoolean("WORKING"))
           {
              exception.addRange(ProjectCalendarWeek.DEFAULT_WORKING_MORNING);
              exception.addRange(ProjectCalendarWeek.DEFAULT_WORKING_AFTERNOON);
           }
  
           currentExceptionID = row.getInteger("NEXT_CALENDAR_EXCEPTION_ID");
        }
     }
docs: Read exceptions for a calendar.
  
  @param table calendar exception data
  @param calendar calendar
  @param exceptionID first exception ID