private static void parseChar(final StringBuilder outputBuilder,
                                  final StringBuilder scratchBuilder,
                                  final char lastChar,
                                  final char currChar) {
        boolean isDifferentChar = lastChar != Character.MIN_VALUE && lastChar != currChar;

        if (isDifferentChar) {
            final String scratch = scratchBuilder.toString();
            scratchBuilder.setLength(0);
            final String jsForm = JAVA_TO_JS_CONVERSION_MAP.get(scratch);
            if (jsForm != null) {
                outputBuilder.append(jsForm);
            } else {
                // Not a java format str so just add it as is
                outputBuilder.append(scratch);
            }
        }
        // Build up a block of repeated chars
        scratchBuilder.append(currChar);
    }
Converts a java syntax date format string into a moment.js syntax date format
string. May not handle all cases so it is possible the output will not be valid
syntax.
stroom-core-client-widget/src/main/java/stroom/widget/customdatebox/client/ClientDateUtil.java