Hello Telerik-Team,
we are using Kendo 2013.2.716 and have an application that is not interested in local timezones. Internally all dates are stored as UTC, but the time part should always be ignored.
- we have a grid and a datepicker with a custom format (yyyy-MM-dd) within this grid
- we have also implemented your guide: Using UTC time on both client and server sides
reading and displaying of the Dates works perfectly :)
Because of our custom date format we also needed to change the parametermap:
For employees in Asia and EU it works perfectly, but for the US (Timezone: UTC-5) we now have the following situation:
- if the user edits a date, the date is correctly sent to the Server (if the user selects Jan 2nd, then 2014-01-02 00:00:00 is submitted to the Server) -> perfect.
- but immediately after the update the grid shows Jan 1st
- only after the user hits the browser's refresh button it loads the correct date from the Server and displays it (Jan 2nd)
If I modify the ParameterMap and add the time offset myself (e.g. options.Startdate = "2014-01-02T05:00:00.000-05:00"), then the grid immediately shows the correct date, but the value sent to the server is useless, because it's a DateTime with Type "local", but I do not have any information about the timezone. If I just ignore the time and only store the date part, then it might be correct for the US users, but will be wrong for the EU & Asians...
Thank you,
Rainer
we are using Kendo 2013.2.716 and have an application that is not interested in local timezones. Internally all dates are stored as UTC, but the time part should always be ignored.
- we have a grid and a datepicker with a custom format (yyyy-MM-dd) within this grid
- we have also implemented your guide: Using UTC time on both client and server sides
reading and displaying of the Dates works perfectly :)
Because of our custom date format we also needed to change the parametermap:
$(document).ready(
function
() {
var
grid = $(
"#Grid"
).data(
"kendoGrid"
),
mvcTransport =
new
kendo.data.transports[
"aspnetmvc-ajax"
]();
grid.dataSource.transport.parameterMap =
function
(options, type) {
if
(type ===
"update"
|| type ===
"create"
) {
var
d =
new
Date(options.Startdate);
options.Startdate = kendo.toString(
new
Date(d),
"yyyy-MM-dd"
);
}
return
mvcTransport.parameterMap(options, type);
};
});
For employees in Asia and EU it works perfectly, but for the US (Timezone: UTC-5) we now have the following situation:
- if the user edits a date, the date is correctly sent to the Server (if the user selects Jan 2nd, then 2014-01-02 00:00:00 is submitted to the Server) -> perfect.
- but immediately after the update the grid shows Jan 1st
- only after the user hits the browser's refresh button it loads the correct date from the Server and displays it (Jan 2nd)
If I modify the ParameterMap and add the time offset myself (e.g. options.Startdate = "2014-01-02T05:00:00.000-05:00"), then the grid immediately shows the correct date, but the value sent to the server is useless, because it's a DateTime with Type "local", but I do not have any information about the timezone. If I just ignore the time and only store the date part, then it might be correct for the US users, but will be wrong for the EU & Asians...
Thank you,
Rainer