public String convert(String pattern) {
        pattern = pattern != null ? pattern : "";
        final JQueryDateTimePatternBuilder builder = new JQueryDateTimePatternBuilder();
        final TokenVisitor visitor = new CombinedDateTimePatternTokenVisitor(builder);
        try {
            PatternReader.parsePattern(pattern, visitor);
        }
        catch (final Exception e) {
            if (LOGGER.isLoggable(Level.SEVERE)) {
                LOGGER.log(Level.SEVERE, "Could not process pattern '{0}" + pattern + "'", e);
            }
            return pattern;
        }
        return builder.toString();
    }
Converts a Java date pattern with the given pattern letters to a JQuery UI
date picker pattern.

@param pattern Pattern to be converted.
@return The converted JQuery UI date picker pattern.
primefaces/src/main/java/org/primefaces/convert/DateTimePatternConverter.java