DatePickerFor display, shows date -1 day in Safari

I am running into an issue where when a date is displayed in Safari and Mobile Safari, the date displayed is 1 day less than the correct value. This is able to reproduced by clicking submit on the demo page here.

The code is setting the date to 3/3/2018, but the page shows 3/2/2018. After submitting, it shows 3/1/2018 and so on.

https://ej2.syncfusion.com/aspnetcore/DatePicker/DatePickerFor#/material

5 Replies 1 reply marked as answer

BR Brian Rutter July 28, 2020 01:32 PM UTC

This issue also occurring on Chrome on an iPhone.


SN Sevvandhi Nagulan Syncfusion Team July 29, 2020 08:25 AM UTC


Hi Brian, 


Greetings from Syncfusion support. 


We would like to inform you that, if you run the application with DatePicker component in the client and server both in different time zone such as server in India will be “+5.5” and client in US will be “-4.0”. So, this difference between server and client time zone will be occurred in the date and time values and DatePicker will displayed the value based on its client time zone value.  
   
So, by adding the serverTimeZoneOffset property, we have handled these variations in source level. For the example above, if you set the serverTimeZoneOffset to "+ 5.5" then DatePicker will display the value in any client side based on the time zone of the server. Hence, we suggest using the serverTimeZoneOffset property and provide the value to the property based on the server time. 


Regards, 
Sevvandhi N 



BR Brian Rutter July 29, 2020 01:25 PM UTC

In my testing, Server and Clients were in the same timezone. 
The DatePicker on Windows is showing the correct date. 
The DatePicker on Mac/iPhone is showing the incorrect date.



SN Sevvandhi Nagulan Syncfusion Team July 30, 2020 11:58 AM UTC

Hi Brian, 

We are currently validating the reported issue. We will update further details with in two business days (4th August,2020). We appreciate your patience until then. 

Regards, 
Sevvandhi N 



SN Sevvandhi Nagulan Syncfusion Team August 4, 2020 01:33 PM UTC

Hi Brian, 


Thanks for the patience. 


While checking the reported issue it seems like the time zone issue in safari and iPhone device. Because, date parsing varies between chrome and safari. Please check the below links for more information. 



 So, we suggest you to follow the solutions given in the below stack overflow link to get rid of the reported issue.. 




Regards, 
Sevvandhi N 


Marked as answer
Loader.
Up arrow icon