function formatJSONDate(jsonDate) {
//2014-09-05T00:00:00
var today = new Date(jsonDate);
var date = today.getDate();
var month = today.getMonth() + 1; //January is 0. so we add + 1;
if (date < 10) {
date = '0' + date
}
if (month < 10) {
month = '0' + month
}
var today = date + FormatMonth(month);
return today;
}
function FormatMonth(jsonMonth) {
var month = '';
switch (jsonMonth) {
case "01":
month = "Jan";
break;
case "02":
month = "Feb";
break;
case "03":
month = "Mar";
break;
case "04":
month = "Apr";
break;
case "05":
month = "May";
break;
case "06":
month = "Jun";
break;
case "07":
month = "Jul";
break;
case "08":
month = "Aug";
break;
case "09":
month = "Sep";
break;
case "10":
month = "Oct";
break;
case "11":
month = "Nov";
break;
case "12":
month = "Dec";
break;
}
return month;
}