code: public static String convertFormat(String format) {
  		if (format == null)
  			return null;
  		else {
  			// day of week
  			format = format.replaceAll("EEE", "D");
  			// year
  			format = format.replaceAll("yy", "y");
  
  			// month
  			if (format.indexOf("MMM") != -1) {
  				format = format.replaceAll("MMM", "M");
  			} else {
  				format = format.replaceAll("M", "m");
  			}
  			return format;
  		}
  	}
docs: Converts a java Date format to a jQuery date format
  
  @param format
  Format to be converted
  @return converted format