monName = new Array( "Jan", "Feb" , "Mar", "Apr", "May" , "Jun", "Jul", "Aug" , "Sept", "Oct", "Nov" , "Dec")
Date.prototype.format = function (format) {
if (!format) {
format = "yyyy-MM-dd hh:mm:ss";
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, ( this.getFullYear() + "" ).substr(4 - RegExp.$1.length));
}
if (/(M+)/.test(format)) {
format = format.replace(RegExp.$1, (monName[ this.getMonth()] + "" ).substr(3 - RegExp.$1.length));
}
if (/(d+)/.test(format)) {
format = format.replace(RegExp.$1, ( "00" + this .getDate() + "").substr(( "" + this .getDate()).length));
}
return format;
};
function formatJsonDate(str) {
if (str != null &&str!='') {
return (new Date(parseInt(str.substring(str.indexOf( '(') + 1, str.indexOf(')' ))))).format("dd-MMM-yyyy");
}
else {
return '' ;
}