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

DateTimePicker Adds timezone-diff to UTC if min-date equals current date

2 Answers 232 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Bastian
Top achievements
Rank 1
Bastian asked on 09 Nov 2015, 03:46 PM

Hi,

 I'am using the DTP with angular. The min-date ist set to today at 00:00:00:

$scope.dtpCfg=

{

   min: new Date(2015, 10, 9),//hardcoded example for today: Date {Mon Nov 09 2015 00:00:00 GMT+0100}

parseFormats: ["dd.MM.yyyy HH:mm"],

interval: 15

};

)



No inital value is provided to the DTP, so the DTP has no value after page load. When the user selects a date this occures:



- if a future day (e.g. tomorrow) is selected the time portion is 00:00:00 (complete: Date {Tue Nov 10 2015 00:00:00 GMT+0100}). Fine, thats assumed.

- if the date-value is set on the minimal possible day (aka today) the time portion is set to 01:00:00 (Date {Mon Nov 09 2015 01:00:00 GMT+0100}). If the browsers timezone is for example changed to China Standard Time so the time portion is 08:00:00h (Date {Mon Nov 09 2015 08:00:00 GMT+0800 (China Standard Time)}).
- if the DTP min-value is not set to today at 00:00:00 but to yesterday 23.59.59 all works fine if todays date will be selected: time portion is 00:00:00h.

 

Any ideas whtas going wrong? Is it just me? I assume always to get the time portion 00:00:00 if on an empty and fresh initialized DTP the date will be set via the ui. Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 11 Nov 2015, 10:17 AM
Hello Bastian,

In general, the DateTimePicker widget works with JavaScript Date object. If the time portion is changed unexpectedly, probably you are seeing the built-in browser support for DST change. Mainly, DST change happens in October, hence you probably are seeing this side effect.

I would suggest you experiment with simple JavaScript Date objects instead of using Date/Time Picker widgets. If the problem does not exists, please send us a repro demo and a concrete list of repro steps. Thus we will be able to review the issue and follow you up with more details.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bastian
Top achievements
Rank 1
answered on 18 Nov 2015, 01:54 PM
Currently I am on the another builing site, so there is no time for jumping again into the theme. For time purposes another solution was taken, so that this malpractice has no influence. Thank you.
Tags
Date/Time Pickers
Asked by
Bastian
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Bastian
Top achievements
Rank 1
Share this question
or