Ok fairly new to javascript entirely - I have the code below which is outputting the date in yyyy-MM-dd format. How would I go about converting this to UK format?
Apologies if this is a silly question but as I say I have kinda been thrown into the deep end and trying to work it out as I go.
dtl.zGetDueDt = function (row, cell, value, col, item) {
if (item) {
console.log("zGetDueDt -item", item);
if (item.duedt === undefined) {
item.duedt = "";
DataService.get('api/ap/apsr/getbyrowid/' + dtl.aptransDataset[row].rowidApsr, { busy: true }, function (data) {
if (data) {
console.log("APICall-data", data);
if (data.duedt !== null) {
dtl.aptransDataset[row].duedt = data.duedt.toString().substring(0, 10);
item.duedt = data.duedt.toString().substring(0, 10);
dtl.aptransGrid.updateRow(row);
}
}
}, row);
return "";
}
else {
return item.duedt;
} // end of else return
} // end of if item
}; // end of function
});