Undocumented use of kendo.timezones

4 posts, 0 answers
  1. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 20 Nov 2014 Link to this post

    I could not find any documentation on the use of kendo.timezones:
    • http://docs.telerik.com/kendo-ui/framework/globalization/overview
    • http://docs.telerik.com/kendo-ui/framework/localization/overview

     

    It seems to me that kendo has all the bricks to handle timezones without requiring momentJS or any other comparable library, but I cannot relally figure out how to use it.

    Ideally, I want to store all dates server side in UTC format and display them in the user's timezone.

    Question 1: Can Kendo UI detect user's timezone or should we let users define their timezone in the application profile?

    Question 2: how do you convert from UTC to local timezone and from local timezone to UTC using the kendo framework?

    Question 3: In a kendo.data.Model or kendo.observable, where do you recommend making conversions?

    Question 4: In a kendo.data.DataSource, where do you recommend making conversions?
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 24 Nov 2014 Link to this post

    Hello Jack,

    Currently, methods part of the kendo.timezones namespace are not documented as they were developed for date modifications in Kendo UI Scheduler. Nevertheless, they are useful when it comes to timezone adjustments and we will document them in some of our next release of Kendo UI. For now please find my comments below:

    #1: Kendo UI cannot detect user's time zone. In general, this is a hard process and will result just in "guessing" the user's time zone. This is the reason why the scheduduler needs a timezone option.

    #2: We do have a convert method that converts Date object from one timezone to another:
    var newDate = kendo.timezone.convert(date, "Europe/Sofia", "Etc/UTC");
    //current date timezone - "Europe/Sofia"
    //convert to "Etc/UTC" timezone
    Here is a demo for a better understanding. Note that method just adjusts time portion of the object. JavaScript Date object always uses browser's timezone.

    #3: One option is to convert the date in Set event of the Model.

    #4: You can convert the dates before return the data in the schema.data callback.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Matt Johnson
    Matt Johnson avatar
    2 posts
    Member since:
    May 2012

    Posted 22 Feb 2015 in reply to Georgi Krustev Link to this post

    It would be helpful if we knew which version of the IANA time zone data was represented in the kendo.timezones.min.js file.  I just downloaded the latest release (Q3 2014) which appears to have come with data from version 2014h of the tzdb.  Perhaps the version number could be included in either the data or the comments of the file?

    It would also be useful to be able to update this file myself - either by running some Telerik-provided utility against the IANA data, or by downloading updated versions from telerik directly.   Telerik releases quarterly, but IANA puts out tzdb updates much more frequently than that.   Depending on the app, it could be critical to apply a time zone update sooner than the next telerik release.

  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 25 Feb 2015 Link to this post

    Hello Matt,

    In general, we update the timezones information with each official release or if some major change has happened in between.

    Currently, the timezone generator is not exposed and can be used only by a Telerik member. 

    I will forward your request idea/request to allow the users to build the timezones information manually against the latest version of IANA library.

    For now, if the timezone files are outdated for some reason, you can contact a Telerik member.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready