Date picker - Wrong date selection with Safari

Hi,

I have a DatePicker in my page and I set the value on rendering.

The selection is always the previous day of the value passed in parameter.

Ex: 
Parameter value = 2018-08-26
Selection = 2018-08-25

After Page rendering, if I select manualy the desired date, everything work fine.

Problem occur only with Safari.

1 Reply

BM Balaji M Syncfusion Team August 30, 2018 05:22 PM UTC

Hi Tommy, 

Thanks for contacting Syncfusion Support. 

We have checked with your query and suspect that the you would have passed the value for the DatePicker component from a server at a different time zone by converting a ISO date string to a DateTime object. If so, then we suggest you to remove the Z factor (Last character as Z) in the ISO string while converting to a DateTime object as shown in the below code snippet to resolve this issue at you end since this factor will convert the date values obtained  based on the client time zone which may result of change in value due the time zone factor. 

Controller 
public ActionResult Index() 
        { 
            ViewBag.Value = Convert.ToDateTime("2011-12-31T18:30:00.000"); 
            return View(); 
        } 
 
Cshtml 
 
@Html.EJS().DatePicker("datepicker").Value(ViewBag.Value).Render(); 
 
For your convenience, we have also attached the sample for your reference. Please check it. 


So please ensure this Z factor from the value before converting the and assigned as DatePicker component value to resolve this issue. Else, if this is not your case, then please revert back to us with the below required information so that we can check for the root cause of the issue and provide an exact solution for your requirement. 

  1. Code block of value assigned to the component
  2. Local machine time zone.
  3. Issue reproducing sample (if possible).


Regards, 
M. Balaji  


Loader.
Up arrow icon