Does the Kendo grid assume all my dates are UTC?

4 posts, 0 answers
  1. Randy
    Randy avatar
    75 posts
    Member since:
    Jul 2009

    Posted 08 May 2017 Link to this post

    I'm running into a situation in my MVC app where the Kendo grid seems to be assuming that my date columns are UTC dates and are converting them to local time. Most of my dates are off by one day. 

    First of all, is this what the grid is doing? Past posts about issues like this seems to confirm it. If so, can I tell the Kendo grid that my dates are not UTC? We're building an app around an existing database where the dates are not stored as UTC and the dates cannot be converted. If I can't tell the Kendo grid to stop doing this, what alternatives do I have? I know I can represent dates as strings in the grid, but then I lost the ability to sort correctly if the user chooses to sort a date column. Converting all date columns in our database to UTC is not an option.

     

  2. Stefan
    Admin
    Stefan avatar
    2834 posts

    Posted 10 May 2017 Link to this post

    Hello Randy,

    The described result is expected.

    I can suggest checking the following forum thread which contains a custom approach and examples how the desired result can be achieved:

    http://www.telerik.com/forums/kendo-grid-automatically-converting-timezone

    Currently, this is the recommended approach, as the built-in one is treating the dates as UTC.

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Randy
    Randy avatar
    75 posts
    Member since:
    Jul 2009

    Posted 10 May 2017 in reply to Stefan Link to this post

    Has Telerik considered changing this default behavior? To assume that every date field in every database that may appear in a Kendo grid will be stored in UTC time is ridiculous. How hard can it be to provide a grid option named something like 'UtcDates' and if it's false, don't convert to local time?
  4. Stefan
    Admin
    Stefan avatar
    2834 posts

    Posted 12 May 2017 Link to this post

    Hello Randy,

    Thank you for the feedback.

    Still, based on the provided link in the linked forum this is because of the specifics of the JavaScript Date object:

    http://stackoverflow.com/questions/8883362/javascript-date-preserve-timezone-offset

    I can also, suggest submitting a feature request, and based on its popularity our developers` team will inspect it and provide this option if possible:

    http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/category/170280-grid?query=UTC

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top