Skip to Content
avatar image
Former Member

Date Value not displaying in the Disabled Date Picker field

Hi All,

I have a application which uses a Datepicker field which is a part of Table rows. Issue I am facing here is that even though the odata service is returning a value for this field, and the binding is correct as well, it just keeps displaying the placeholder in the output. Unfortunate part here is that there is no Error in the console either. I know the information above is not much to go on with, but has anyone ever faced a similar issue and had a resolution for it do let me know.

Any feedback or ideas will be appreciated.

here is the datepicker definition if this helps in anyway.

<DatePicker enabled="false" value="{path: 'CovenantDate', formatter: '.fnFormatDates'}" displayFormat="dd/MM/yyyy" valueFormat="yyyy-MM-dd" change="onSaveTables" />

Hereis the formatter function :

fnFormatDates: function(oValue){
// format date
if (oValue) {
var oDateFormat = sap.ui.core.format.DateFormat.getDateInstance({
pattern: "dd/MM/yyyy",
UTC: true
});
return oDateFormat.format(new Date(oValue));
} else {
return oValue;
}
},

Regards,

Parth Shah

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 19 at 10:54 AM

    I don't think you need a formatter there just to display the date. Try this if it works:

    <DatePicker enabled="false" value="{path: 'CovenantDate', type: 'sap.ui.model.type.Date'}" displayFormat="dd/MM/yyyy" valueFormat="yyyy-MM-dd" change="onSaveTables" />
    Add comment
    10|10000 characters needed characters exceeded