cancel
Showing results for 
Search instead for 
Did you mean: 

Setting date from OData response without conversion

Former Member
0 Kudos

Is there a way to set the date (Edm.DateTime) i get from odata read request. I mapped the odata to my datePicker as follows

value: {

  path: "ActionsData>/HireDate",

  type: new sap.ui.model.type.Date({

     source: {

      pattern: "timestamp"

     },

     pattern: "dd.MM.yyyy",

     strictParsing: true

  })

},

but unfortunatelly the date is displayed like: NaN.NaN.0NaN

Any ideas to how to display the date in format dd.MM.yyyy with minimal effort?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I've set my datepicker's format using the following code, it might help you out a bit:


var datePicker = new sap.m.DatePicker({

     valueFormat: "yyyyMMdd",

     value: "{dateValue}"

});

You can probably just change the valueFormat to contain the following string: "ddMMyyyy".

Hope this is helpful.

Regards