String getFormattedDate(CmsDateFormatOption formatOption) {

        if (null == formatOption) {
            return getFormattedDate(DateFormat.SHORT);
        }
        String result;
        if (isWholeDay()) {
            result = formatOption.formatDate(getStart());
            if (getLastDay().after(getStart())) {
                String to = formatOption.formatDate(getLastDay());
                if (!to.isEmpty()) {
                    result += DATE_SEPARATOR + to;
                }
            }
        } else {
            result = formatOption.formatDateTime(getStart());
            if (getEnd().after(getStart())) {
                String to;
                if (isMultiDay()) {
                    to = formatOption.formatDateTime(getEnd());
                } else {
                    to = formatOption.formatTime(getEnd());
                }
                if (!to.isEmpty()) {
                    result += DATE_SEPARATOR + to;
                }
            }
        }

        return result;
    }
String getFormattedDate ( CmsDateFormatOption formatOption ) { if ( null == formatOption ) { return getFormattedDate ( DateFormat . SHORT ) ; } String result ; if ( isWholeDay ( ) ) { result = formatOption . formatDate ( getStart ( ) ) ; if ( getLastDay ( ) . after ( getStart ( ) ) ) { String to = formatOption . formatDate ( getLastDay ( ) ) ; if ( ! to . isEmpty ( ) ) { result += DATE_SEPARATOR + to ; } } } else { result = formatOption . formatDateTime ( getStart ( ) ) ; if ( getEnd ( ) . after ( getStart ( ) ) ) { String to ; if ( isMultiDay ( ) ) { to = formatOption . formatDateTime ( getEnd ( ) ) ; } else { to = formatOption . formatTime ( getEnd ( ) ) ; } if ( ! to . isEmpty ( ) ) { result += DATE_SEPARATOR + to ; } } } return result ; }
Returns the start and end dates/times as "start - end" in the provided date/time format specific for the request locale.
@param formatOption the format to use for date and time.
@return the formatted date/time string.