Here is my code
var dateEditor = function (ui) {
var $cell = ui.$cell,
rowData = ui.rowData,
dataIndx = ui.dataIndx,
cls = ui.cls,
dc = $.trim(rowData[dataIndx]);
$cell.css('padding', '0');
var $inp = $("<input type='text' id='" + dataIndx + "' name='" + dataIndx + "' class='" + cls + " pq-date-editor' style='position: relative; z-index: 100;border: 3px solid rgba(0,0,0,0);'/>")
.appendTo($cell)
.val(dc).datepicker({
changeMonth: true,
changeYear: true,
dateFormat:"dd/mm/yy",
onClose: function () {
$inp.focus();
}
});
}
{ title: "Date", dataIndx: "date", width: 150, align: "center", dataType: "date", resizable: false
,render: function (ui) {
if (ui.cellData==null)
{
return '';
}
else
{
console.log(ui.cellData);
var date = new Date(ui.cellData);
var xdd = date.getDate();
var xmm = (date.getMonth() + 1);
var xyy = date.getFullYear();
if (parseInt(xdd)<10){xdd='0'+xdd;}
if (parseInt(xmm)<10){xmm='0'+xmm;}
return xdd + '/' + xmm + '/' + xyy;
}
}
,editor: {type: dateEditor}
},