Api returns a date but grid displays the previous date.

Hi I have an issue where my OData response is correct with the below data but my grid displays a day prior to all dates.

<SfGrid TValue="PurchaseOrder" Query="@(new Query().Where("OrderNumber", "equal", SelectedPurchaseOrderSummary.OrderNumber))" AllowFiltering="true" AllowPaging="true">

                                    <SfDataManager Url="odata/PurchaseOrders" Adaptor="Adaptors.ODataV4Adaptor" CrossDomain="true"></SfDataManager>

                                    <GridFilterSettings Mode="FilterBarMode.Immediate" ImmediateModeDelay="300"></GridFilterSettings>

                                    <GridColumns>

                                        <GridColumn Field=@nameof(PurchaseOrder.Model) HeaderText="Model"></GridColumn>

                                        <GridColumn Field=@nameof(PurchaseOrder.AlternateModel) HeaderText="Your Model"></GridColumn>

                                        <GridColumn Field=@nameof(PurchaseOrder.Price) HeaderText="Price" Format="c2"></GridColumn>

                                        <GridColumn Field=@nameof(PurchaseOrder.QuantityOrdered) HeaderText="Quantity" Type="ColumnType.Number" Width="100"></GridColumn>

                                        <GridColumn Field="@nameof(PurchaseOrder.QuantityShipped)" HeaderText="Shipped" Type="ColumnType.Number" Width="100"></GridColumn>

                                        <GridColumn Field="@nameof(PurchaseOrder.ETA)" HeaderText="EST. Ship Date" Format="d" Type="ColumnType.Date"></GridColumn>

                                        <GridColumn Field="@nameof(PurchaseOrder.RevisedETA)" HeaderText="Revised EST. Ship Date" Format="d" Type="ColumnType.Date">

</GridColumn>

                                    </GridColumns>




  1. ETA: "2021-11-16T00:00:00Z"
  2. Model: "4433-0"
  3. OrderDate: "2021-09-27T00:00:00Z"

  4. RevisedETA: "2021-11-26T00:00:00Z"

4 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team October 12, 2021 11:54 AM UTC

Hi Mason, 
 
Greetings from Syncfusion support. 
 
We have validated your query by preparing a sample in the latest version but unfortunately we are unable to reproduce the reported problem from our end. Please find the validated sample and the screenshot for your reference below. 
 
 
Grid Data: 
 
 
 
Grid: 
 
 
 
If you are still facing the reported problem then kindly share us the below details, 
 
  1. Share us the Syncfusion NuGet version details.
  2. Kindly share us the issue reproducing sample or reproduce the issue in the above provided sample.
 
The above requested details will be helpful for us to validate your query and to provide you with a better solution ae early as possible. 
 
Regards, 
Jeevakanth SP. 



MC Mason Channer October 12, 2021 03:24 PM UTC

Thank you upon testing your sample and my sample locally I do not find the issue, the correct dates are shown. 

When I publish to Azure App Service, I get the issue where the dates are off by 1 day. Showing the previous day in the grid.

I am able to reproduce this issue by publishing your sample to Azure.  Syncfusion (caltestelectronics3.azurewebsites.net)  

But I have confirmed with your sample and my sample that the OData is sending the correct date in the response.

Maybe this is more of an Azure issue, but I am hoping you can help me on this.



MC Mason Channer October 12, 2021 04:07 PM UTC

Hello, I have figured out the issue to be the timezone of my Azure testing environment. I did not know Azure was UTC be default and not my local PST timezone.

Following this blog, I now get the correct Dates after converting UTC to the localtime using the local offset.

Convert DateTime to user's time zone with server-side Blazor - Meziantou's blog


Marked as answer

JP Jeevakanth Palaniappan Syncfusion Team October 13, 2021 05:36 AM UTC

Hi Mason, 
 
We are glad that you have resolved the problem. Get back to us if you have any other queries. 
 
Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon