Hi Experts,
I searched all threads & couldn't find solution for date formatting issue.
I'm trying to display date with date formatter function in formatter.js file.
My display field is written as below.
<ObjectAttribute text="{StartDate, formatter : '.date'}"/>while my formatter.js is written as follows.
jQuery.sap.require("sap.ui.core.format.DateFormat");
sap.ui.define([ ], function () {
"use strict";
return {
currencyValue : function (sValue) {......... },
//Date function to display date in mm/dd/yyyy format
date: function(value){ //Date(1451635200000)/
var value1 = value.substring(7,20);
var oDateFormat = sap.ui.core.format.DateFormat.getDateInstance(
{value1: "dd/MM/yyyy"}); //Returns a DateFormat instance for date and time
value = oDateFormat;
return value;
}
};
But it is displaying as blank. Thanks in advance.
Sameer