You'd have to separate the date and month, keep an array of valid months, then pass those numbers into new Date
, something like
function parseDate(d) {
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec']
var date = +d.replace(/\D/g,'');
var mon = months.indexOf( d.replace(/\d/g,'') );
return new Date(2017, mon, date);
}
console.log( parseDate("09Aug") );
console.log( parseDate("23Aug") );
console.log( parseDate("Sept27") ); // why four letters ?
(Note: dates are "local" in JS, so parsing them could result in differences, use UTC if important)