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.
- Code block of value assigned to the component
- Local machine time zone.
- Issue reproducing sample (if possible).
Regards,
M. Balaji