I have a xp:dataTable where one column has computed Field that shows DateTime value. I want to show only time for current date (Today) and date/Time for all other dates. Here is what I put into computed field converter:
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:rowData.getColumnValue("START_DATE")}]]></xp:this.value>
<xp:this.converter>
<xp:convertDateTime type="date">
<xp:this.type>
<![CDATA[${javascript:
var inputDate = new Date(this.value);
var todaysDate = new Date();
if(inputDate.setHours(0,0,0,0) == todaysDate.setHours(0,0,0,0)){
return "time";
} else {
return "both";
}
}]]>
</xp:this.type>
</xp:convertDateTime>
</xp:this.converter>
but it doesn't work. Any ideas? Should I format it somehow with CSS? Thanks