If you want to format from a Date object, use this:
function formatDate(date) { //takes a Date object
var monthArr = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec']; //creates array of month names
var month = monthArr[date.getMonth()]; //selects array element equal to getMonth(), which ranges from 0-11
var year = date.getFullYear()%100; //takes the full year (4 digits) mod 100, so the last two digits
var dateString = month + ' ' + year;
return dateString;
}
If you want to format a string, like the one you provided, use this:
function formatDate2(str) { //takes a string
var dateArr = str.split(' '); //creates array from string, splitting by spaces
var dateString = dateArr[1] + ' ' + dateArr[3].slice(2,4); //gets element 1 (month) and the last two digits of of element 3 (year)
return dateString;
}