Impossible to select time repeated during DST time change

2 posts, 0 answers
  1. Peter
    Peter avatar
    9 posts
    Member since:
    Dec 2013

    Posted 16 Sep 2015 Link to this post

    I hate bringing this up, because DST can be such a mind #$%$. But here we go: 

    I have declared a Kendo datetimepicker like so:


    .Format("yyyy/MM/dd HH:mm zzz")


    I'll be using MST as my example timezone, ie. -6:00 or -7:00. On November 1st @ 2:00 AM time goes backwards 1 hour. So basically the time one second after 1:59:59 AM (-06:00) becomes 1:00:00 AM (-07:00)

    The KendoDateTimePicker seems to be smart enough to recognize the timezone change. For example, selecting November 1st 00:30 (pre-time change) will show a timezone of (-06:00), and selecting November 1st 02:00 (post time change) will show a timezone of (-07:00)

    The tricky part with the November time change is that there are two occurrences of 01:00:00 - 01:59:59 during that day. The first occurrence has a timezone of -06:00 and the second has a timezone one less, of -07:00. So the question is, how do I select one occurrence or the other, without having to manually input the timezone?

    The expectation is that the clients current timezone is used. So if the current local time is before the time change (-06:00), then if I select November 1st 01:30 I expect the timezone to be (-06:00). If the current local time is after the time change (-07:00), then if I select November 1st 01:30 I expect the timezone to be (-07:00).

     At the moment the KendoDateTimePicker doesn't match those expectations, and instead defaults to the pre-time change timezone of (-06:00) regardless of what the timezone of the web server or the client is. It is therefore impossible to select time between 01:00:00 - 01:59:59 (-07:00).

    Is this a bug or is there someway of making the datetimepicker aware of the client's current timezone?

  2. Georgi Krustev
    Georgi Krustev avatar
    3688 posts

    Posted 18 Sep 2015 Link to this post

    Hello Peter,

    The DateTimePicker uses JavaScript Date object internally to handle any date manipulation. That being said, we depend on the default Date behavior regarding local timezone information and DST changes.
    This means that, we just extract the date parameters from the typed value and then pass them to the Date constructor. From there, the browser handles the Date creation.

    Based on the given information, if the browser implementation is to create date in (-06:00) timezone, then there is nothing that we can do in this case.

    Georgi Krustev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top