I have a table with 2 columns: Keys and Values.
The keys are dates, formatted with the sap time format. Something like this:
"/Date(1510700400000)/"
I have a function which shows the date in a readable form.
convertDate: function() {
if (value === 'null') {
return value.replace('null', 'no date specified')
} else {
var d = new Date(parseInt(value.replace('/Date(', '').replace(')/', ''), 10))
}
var month = d.getUTCMonth() + 1 // months from 1-12
var day = d.getUTCDate()
var year = d.getUTCFullYear()
return year + '/' + month + '/' + day
},
I access my value via:
oTable2.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({
text: "RDATE"
}),
sortProperty: "RDATE",
template: new sap.ui.commons.TextView().bindProperty("text", "key")
}));
Now I want to call my function on "key".
How can I accomplish that? :)