public static String format ( String format ) { if ( format == null ) { format = DEFAULT_FORMAT ; } else { if ( format . contains ( "M" ) ) { format = format . replace ( "M" , "m" ) ; } if ( format . contains ( "Y" ) ) { format = format . replace ( "Y" , "y" ) ; } if ( format . contains ( "D" ) ) { format = format . replace ( "D" , "d" ) ; } } return format ; }
Will auto format the given string to provide support for pickadate . js formats .