Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Set value of DateTimeInput control from OData

Hello,

I'm trying to insert a date which is a json response to read() method:

var oDateTimeInput = new sap.m.DateTimeInput({

     type: "DateTime"

});

oDateTimeInput.setValue(results[0].DiscontinuedDate);

Here how looks the json response:

{results:

[

     {

     DiscontinuedDate: "Sat Oct 01 2005 03:00:00 GMT+0300 (Jerusalem Time (summer))",

     ID: "1",

     Description: "One"

     }

]}

I get the following error:

Format Error: value property Sat Oct 01 2005 03:00:00 GMT+0300 (Jerusalem Time (summer)) does not match with valueFormat M/d/yyyy, h:mm a of Element sap.m.DateTimeInput#updateFormReleaseDate

How do I insert the value? How do I make DateTimeInput control accept the value?

Tags:
replied

my bad



oDateTimeInput.setDateValue( new Date(  "Sat Oct 01 2005 03:00:00 GMT+0300 (Jerusalem Time (summer))" ) );

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question