Binding OData to sap.m.DatePicker does not work for 31.12.9999
I found this strange behaviour of the DatePicker while consuming our OData service:
Service returns something like this:
ValidFrom: "/Date(1285891200000)/" (1.10.2010)
ValidTo: "/Date(253402214400000)/" (31.12.9999)
Then the datepickers are initialized like this
<DatePicker dateValue="{model>ValidFrom}" />
<DatePicker dateValue="{model>ValidTo}" />
Which then looks like this

Opening the Diagnostics reveals that the dateValue is somehow not set

Manually setting it to that date does work btw
picker.setDateValue(new Date(253402214400000));
What is the UI5 version your are using? Did you try to test this with the latest version?
We are embedding the latest stable version directly from the CDN.
https://sapui5.netweaver.ondemand.com/sdk/sap-ui-core.js
Yes, thats SapUI5 and not OpenUI5, but it's working with neither, I also tested it with
https://openui5beta.netweaver.ondemand.com/resources/sap-ui-core.js
Thanks. I will have a look into it.
@mschleeweiss I'm sorry, I did not have a deeper look into this, yet.
To be able to reproduce this issue some more information would be really helpful:
- How is the ODataModel initialized?
sap.ui.model.odata.ODataModelorsap.ui.model.odata.v2.ODataModel? Configuration options? - A plain service response of the bound entity (just the two fields)
A running example where this can be reproduced would really speed up processing this issue (even without a real OData Service as backend).
I did some debugging, hope that helps.

Line 204: Problematic function Line 205: if clause is falsy (thats OK, since current dateValue should be null) Line 208: if clause is falsy (thats OK, since o is a valid date.. btw maybe switch first and second if clause?) Line 211: if clause is truthy (thats bad.... since oMaxDate is defined as Fri Dec 31 9999 00:00:00 GTM+0100) Line 217: Even though its invalid, date gets formatted Line 222: if clause is falsy, since DOM element is not yet rendered/available.
Thats why manually setting the date (picker.setDateValue(new Date(253402214400000));) works: The element is already rendered, so the value will be updated in line 225).
I am not sure why it works like that. An invalid date is displayed (if dom exists), but not stored in the underlying property. Imo the date should be neither displayed nor stored if it's invalid.
Anyway.. suggested solution: Increase maxDate by a few hours.
Concerning your other question: We are doing this in our manifest.json..
"dataSources": {
"entitiesRemote": {
"uri": "https://host:1234/sap/opu/odata/SAP/whatever/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
Thanks! We will have a look into it. Int. reference 1580225795
@mschleeweiss we could finally fix this issue. It will be part of 1.36.1 and 1.34.4. Those versions are not officially released as stable versions, yet. But you should be able to test this fix as soon as the next 1.34 patch is released via the openui5beta deployment.
Looks like this will be the first 1.34 stable release, then, some time after February 10th.