I have an MVC5 application running the latest version of Kendo. I have a ViewModel with a DateTime property:
And in my controller I am instantiating this VM and setting the StartDate property to UtcNow:
And in my view I create a KendoDateTimePicker and bind it to my StartDate property in my model:
The datetimepicker will display the time in UTC, and when the form is submitted the time returned to the controller is in UTC.
However I'm looking at accomplishing two things:
1. Display local time to the client in the date time picker
2. Return the value of the date time picker in UTC to the server
This means that somewhere on the client side the conversion from UTC to Local time must be made for display purposes. Then another conversion from Local Time to UTC when posting back the date to the server.
Is there anyway of having the DateTime picker display a local datetime when bound to a UTC date? If not, is there some event or hook I can use to pre-process the value that the datetimepicker is bound to on the client side?
Similar question for when submitting the form. Is there an event or hook I can use to have the value of the datetimepicker be returned as its UTC equivalent?