question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ODataStore dates conversions

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
MasDevProjectcommented, May 16, 2019

Have you tried to set dateSerializationFormat to null?

@hakimio thank you. It does the trick. So, the solution is: [dateSerializationFormat]="null" in the html element and deserializeDates:false into the store obj.

I think that this is not as clear as it should be

0reactions
LexDXcommented, Dec 24, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found