code: private void processExceptions(ProjectCalendar calendar) throws Exception
     {
        List<Row> rows = getRows("select * from zcalendarrule where zcalendar=? and z_ent=?", calendar.getUniqueID(), m_entityMap.get("CalendarExceptionRule"));
        for (Row row : rows)
        {
           Date startDay = row.getDate("ZSTARTDAY");
           Date endDay = row.getDate("ZENDDAY");
           ProjectCalendarException exception = calendar.addCalendarException(startDay, endDay);
  
           String timeIntervals = row.getString("ZTIMEINTERVALS");
           if (timeIntervals != null)
           {
              NodeList nodes = getNodeList(timeIntervals, m_dayTimeIntervals);
              for (int loop = 0; loop < nodes.getLength(); loop++)
              {
                 NamedNodeMap attributes = nodes.item(loop).getAttributes();
                 Date startTime = m_calendarTimeFormat.parse(attributes.getNamedItem("startTime").getTextContent());
                 Date endTime = m_calendarTimeFormat.parse(attributes.getNamedItem("endTime").getTextContent());
  
                 if (startTime.getTime() >= endTime.getTime())
                 {
                    endTime = DateHelper.addDays(endTime, 1);
                 }
  
                 exception.addRange(new DateRange(startTime, endTime));
              }
           }
        }
     }
docs: Process calendar exceptions.
  
  @param calendar parent calendar.