Solution:
Add a 'postRender' script to the date field(s) you like to format.
- Therefore, go to the (view)screen where you like to format the date.
- Select the field which shows a date. Let say 'StartDate'.
- Click on 'Write code' on top of the window and select 'StartDate_postRender'.
- Add the following piece of code:
myapp.ViewProject.StartDate_postRender = function (element, contentItem) {
// Write code here.
contentItem.dataBind("value", function (value) {
if (value) {
$(element).text(value.format("dd-MM-yyyy"));
}
})
};
Done.