This is a migrated thread and some comments may be shown as answers.

Impossible to select time repeated during DST time change

1 Answer 32 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 16 Sep 2015, 05:15 PM

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

I have declared a Kendo datetimepicker like so:

 

@(Html.Kendo().DateTimePicker()
.Name("StartDatePicker")
.Format("yyyy/MM/dd HH:mm zzz")
.TimeFormat("HH:mm")
)​

 

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?

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Sep 2015, 09:45 AM
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.

Regards,
Georgi Krustev
Telerik
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
Tags
Date/Time Pickers
Asked by
Peter
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or