code: private void setWorkingDays(ProjectCalendar mpxjCalendar, Calendars gpCalendar)
     {
        DayTypes dayTypes = gpCalendar.getDayTypes();
        DefaultWeek defaultWeek = dayTypes.getDefaultWeek();
        if (defaultWeek == null)
        {
           mpxjCalendar.setWorkingDay(Day.SUNDAY, false);
           mpxjCalendar.setWorkingDay(Day.MONDAY, true);
           mpxjCalendar.setWorkingDay(Day.TUESDAY, true);
           mpxjCalendar.setWorkingDay(Day.WEDNESDAY, true);
           mpxjCalendar.setWorkingDay(Day.THURSDAY, true);
           mpxjCalendar.setWorkingDay(Day.FRIDAY, true);
           mpxjCalendar.setWorkingDay(Day.SATURDAY, false);
        }
        else
        {
           mpxjCalendar.setWorkingDay(Day.MONDAY, isWorkingDay(defaultWeek.getMon()));
           mpxjCalendar.setWorkingDay(Day.TUESDAY, isWorkingDay(defaultWeek.getTue()));
           mpxjCalendar.setWorkingDay(Day.WEDNESDAY, isWorkingDay(defaultWeek.getWed()));
           mpxjCalendar.setWorkingDay(Day.THURSDAY, isWorkingDay(defaultWeek.getThu()));
           mpxjCalendar.setWorkingDay(Day.FRIDAY, isWorkingDay(defaultWeek.getFri()));
           mpxjCalendar.setWorkingDay(Day.SATURDAY, isWorkingDay(defaultWeek.getSat()));
           mpxjCalendar.setWorkingDay(Day.SUNDAY, isWorkingDay(defaultWeek.getSun()));
        }
  
        for (Day day : Day.values())
        {
           if (mpxjCalendar.isWorkingDay(day))
           {
              ProjectCalendarHours hours = mpxjCalendar.addCalendarHours(day);
              hours.addRange(ProjectCalendarWeek.DEFAULT_WORKING_MORNING);
              hours.addRange(ProjectCalendarWeek.DEFAULT_WORKING_AFTERNOON);
           }
        }
     }
docs: Add working days and working time to a calendar.
  
  @param mpxjCalendar MPXJ calendar
  @param gpCalendar GanttProject calendar