ODataStore dates conversions
See original GitHub issueBug Report
Hi I’m using a devextreme DataGrid with OData and ODataStore. Everything works fine except the dates which are showed in UTC from the grid.
Our endpoint for OData returns dates in this format: "2019-05-15T08:19:17.158253Z"
which is ISO 8601 and UTC.
It looks like dates in the store are re-converted in UTC and then in local time. In fact using a template for the date columns to print the column value, the date was moved another 2 hours back (our localtime is GTM+2).
The following is a sample response from our endpoint:
{
"@odata.context":"http://localhost:5000/api/audit-records?%24top=30&%24count=true",
"@odata.nextLink":"http://localhost:5000/api/audit-records?$top=0&$count=true&$skip=30",
"value":[
{
"id":1,
"timestamp":"2019-05-15T08:19:17.158253Z",
"auditAction":2,
"entityName":"Product",
"message":"Updated Product with id 2",
"retailerId":null,
"retailerName":null,
"userId":1,
"userName":"admin"
}
],
"@odata.count":1
}
Package versions:
devexteme version: 18.2.8
devextreme-angular version: 18.2.8
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
ODataStore converts date values incorrectly
ODataStore returns date values as is, and it does not transform them by applying a local time zone offset. If you wish to...
Read more >Date and Time Related Controls: Data Binding - SAPUI5 SDK
Date and time related controls can be bound to an OData service. ... If Date is specified, the binding type performs the UTC...
Read more >Custom JavaScript in Cognos – Searchable Checkbox List
In this article, I will explore how to get one of my most popular widgets for Cognos 10 – the searchable checkbox list...
Read more >Libraries · OData - the Best Way to REST
Library to convert OData query directly to SQL query without IQueryable or entity framework. It is useful when the data model is dynamic...
Read more >Additional Best Practices for Defining Requests and Offline ...
Additional Best Practices for Defining Requests and Offline OData Store ... during the initial refresh of data (retrieving the database for the first...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hakimio thank you. It does the trick. So, the solution is:
[dateSerializationFormat]="null"
in the html element anddeserializeDates:false
into thestore
obj.I think that this is not as clear as it should be
The initial problem is resolved, so I closed the issue. As for the documentation, we will consider adding more information about serialization specifics in the future, but I can’t provide you with any time frames.