Kendo UI grid Date Time UTC & DatePicker

5 posts, 0 answers
  1. Aleksandr
    Aleksandr avatar
    67 posts
    Member since:
    May 2016

    Posted 26 Jul 2018 Link to this post

    Hello,

    we ran into the issue when grid automatically convert datetime to local one, but in popup for explme we have a form with standard  DateTime picker which does not do that, as a result of it we have diff dates in grid & in the popup when we edit the grid row. 

    are there any solution we can use to make it consistent? The preferable will be DateTime picker behavior when date is displayed as it is 

     

    Thx Alex

     

     

  2. Aleksandr
    Aleksandr avatar
    67 posts
    Member since:
    May 2016

    Posted 29 Jul 2018 in reply to Aleksandr Link to this post

    solution was found, but it is so wired that Telerik could not implement it, i read a lot of post where it was explained that it will affect existing clients, but ...... just leave this behavior as default and let us ability by setting some property have the dates in UTC. 
  3. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2499 posts

    Posted 30 Jul 2018 Link to this post

    Hello Alex,

    By default when a date is returned from the server the browser will apply an offset to it corresponding to the current client-side time zone. In order to use the same time zone on the server and client I would suggest the approach illustrated in the following article.

    https://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/editing/utc-time-on-both-server-and-client

    It uses the DataSource requestEnd event to remove the applied offset so the same date and time is shown on the client and server. 

    Regards,
    Viktor Tachev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Adrian Segovia
    Adrian Segovia avatar
    12 posts
    Member since:
    Dec 2009

    Posted 15 Jul 2020 in reply to Viktor Tachev Link to this post

    Hello, I've use this solution before. However I just started to have problems again.

    it looks like this piece is no longer valid: prop.indexOf("/Date(") == 0)
    The date does not come with it and it does not apply the offset.

    Could you help?
    Thanks 
    Adrian

  5. Tsvetomir
    Admin
    Tsvetomir avatar
    796 posts

    Posted 17 Jul 2020 Link to this post

    Hi Adrian,

    In case the ASP.NET MVC wrappers are used for serving the data, then you should set the following option of the DataSource:

    .StringifyDates(true)

     

    Regards,
    Tsvetomir
    Progress Telerik

Back to Top