public static String parse(String startMonth, String startYear, String endMonth, String endYear, String isCurrent, String datePattern) throws ParseException {
        boolean current = Boolean.parseBoolean(isCurrent);
        SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
        String startDateString;
        String endDateString;
        if (startMonth != null && startYear != null) {
            Date startDate = sdf.parse(startMonth + "/" + startYear);
            startDateString = new SimpleDateFormat(datePattern).format(startDate);
        } else {
            startDateString = "Unknown";
        }
        if (current) {
            endDateString = "Present";
        }
        else {
            if (endMonth != null && endYear != null) {
                Date endDate = sdf.parse(endMonth + "/" + endYear);
                endDateString = new SimpleDateFormat(datePattern).format(endDate);
            } else {
                endDateString = "Unknown";
            }
        }
        return startDateString + "-" + endDateString;
    }