I have a date format as 2016-01-09.Now I want to convert this date format in to 09-Jan-2016 I was able to convert in to 09-01-2016.But how can i get the month name added there.can someone help.. Here is the code which iam trying
function formatDate(input){
var datePart = input.match(/\d+/g),
year = datePart[0].substring(0,4), // get only two digits
month = datePart[1], day = datePart[2];
return day+'-'+month+'-'+year;
}
formatDate ('2010-01-18'); // "18-01-2010"