New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Section "Binding of date and time values to DateTimePicker" contains misleading text #2543
Comments
|
Forwarded to development via #1970273628 |
|
HI @boghyon, the type sap.ui.model.odata.type.DateTime is designed for entity property with type Edm.DateTime. Edm.DateTime is a string representation of a date and it doesn't contain timezone information. Therefore it's recommended to always use UTC to eliminate ambiguity caused by time zone difference. The mentioned code from datajs is used to convert a date object in the model before setting it to the backend. But if a property has Edm.DateTime type, this function isn't used. Best regards, |
|
Hi @stopcoder,
Maybe I'm misunderstanding or overlooking something but that Here is a minimal sample: https://jsbin.com/pulunib/edit?js,output
We can see that the debugger stops in that function, meaning the values are always sent as UTC ( Could you verify if it's true? As far as I understood, the
In that case, users would have to add/subtract their local time offset every time they enter date-time values because the app tells them to do so. It's hard to believe that this the UX that UI5-apps should provide. |
|
Hi @boghyon, thank you for making the example and I now fully understand what the issue is. My last comment is related to I always thought that once a property is set to type You are right that the documentation should be adapted. The I will forward the internal incident to the responsible colleague. Best regards, |
|
The Note below the
It's confusing because that Note comes right after the IMHO, it would be better if that Note could be moved below the Another issue in the same topic: #2591 |
|
As the quoted text has been removed by SAP/openui5-docs@b9063cf, this issue can be closed. |
|
Hi @boghyon, I forget to post an update to this as you already found that we removed the text in question. Therefore I would like to close this issue report. Best regards, |
URL (minimal example if possible)
https://openui5nightly.hana.ondemand.com/#/topic/e1ddc69c01474faf830a522db8c9238a
Steps to reproduce the problem
Open the above topic page
Scroll down to the section Binding of date and time values to DateTimePicker
It says the following:
This is slightly incorrect. The value chosen by the user is always converted to UTC before it's sent to the backend, no matter whether
formatOptions: { UTC: true }is set or not.Internally, datajs uses
getTime()which is always in UTC.openui5/src/sap.ui.core/src/sap/ui/thirdparty/datajs.js
Lines 1482 to 1484 in c3f3c0e
What is the expected result?
What happens instead?
formatOptions: { UTC: true }is always required whenever'sap.ui.model.odata.type.DateTime'is used, even though it depends on the use case/ user preference.The text was updated successfully, but these errors were encountered: