I don't know where you got that Date.parse call, JavaScript's Date.parse has no second argument.
To do this, you'll need to parse the string yourself, or use MomentJS or similar to do it for you. If you want to parse it yourself, you'll probably want a regular expression and a lookup table (for the month names). The regex would be along these lines:
var parts = /^\s*(\d+)\s+([A-Za-z]+)\s+(\d+)\s*$/.exec(str);
...where you'd end up with parts[0] being the day, parts[1] the month name, and parts[2] the year. Then just convert the month to lower or upper case, and use a lookup table to map month name to month number, something along these lines:
var months = {
"jan": 0,
"january": 0,
"feb": 1,
"february": 1,
"may": 4,
// ...
"dec": 11,
"december": 11
};
var parts = /^\s*(\d+)\s+([A-Za-z]+)\s+(\d+)\s*$/.exec(str);
var dt;
if (parts) {
parts[2] = months[parts[2].toLowerCase()];
if (typeof parts[2] !== "undefined") {
dt = new Date(parseInt(parts[3], 10),
parts[2],
parseInt(parts[1], 10));
}
}
Live example | source
Then you can format the resulting Date object. (Again, there are libs to help there.)
Or, of course, never actually make a Date and just format directly from parts.
Date.parseonly takes one parameter.