code: @Deprecated public Duration getDuration(String calendarName, Date startDate, Date endDate) throws MPXJException
     {
        ProjectCalendar calendar = getCalendarByName(calendarName);
  
        if (calendar == null)
        {
           throw new MPXJException(MPXJException.CALENDAR_ERROR + ": " + calendarName);
        }
  
        return (calendar.getDuration(startDate, endDate));
     }
docs: This method is used to calculate the duration of work between two fixed
  dates according to the work schedule defined in the named calendar.
  The name of the calendar to be used is passed as an argument.
  
  @param calendarName name of the calendar to use
  @param startDate start of the period
  @param endDate end of the period
  @return new Duration object
  @throws MPXJException normally when no Standard calendar is available
  @deprecated use calendar.getDuration(startDate, endDate)