Skip to Content
0
Former Member
Jun 05, 2014 at 02:48 PM

Odata, XML, DateTimeInput & Databinding

219 Views

Hi all,

sorry if it is written somewhere but i did not manage to find an accurate information about my issue.

i am trying to bind an DateTimeInput to a value named LicenceDate, which is a Date in my oDataModel.

<DateTimeInput id="inputLicenceDate" type="Date" placeholder="Enter driver's licence date"
                                                value="{LicenceDate}"  
                                                displayFormat='dd/MM/yyyy'
                                                />

when displaying it throws an error :

2014-06-05 16:37:25 Format Error: value property Mon May 01 2000 00:00:00 GMT+0200 (Romance Standard Time) does not match with valueFormat dd/MM/y of Element sap.m.DateTimeInput#driverFormPage--inputLicenceDate -


I have already tried

<DateTimeInput id="inputLicenceDate" type="Date" placeholder="Enter driver's licence date"
                                                dateValue="{LicenceDate}"  
                                                displayFormat='dd/MM/yyyy'
                                                />

But it throws an error without displaying anything :

Error: Type Error: Expected JavaScript Date Object for property dateValue of Element sap.m.DateTimeInput#driverFormPage--inputLicenceDate

But, when i display the model in the console it says that the bound data is an Date Object :

LicenceDate : Date {Mon May 01 2000 00:00:00 GMT+0200 (Romance Standard Time)}

Can somebody show me the way?

Regards,

Marc