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

DatePicker resetting time when used with jQuery 1.6.2

4 Answers 318 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Oleg
Top achievements
Rank 1
Oleg asked on 03 Sep 2011, 12:54 AM
Hi,

I have a DatePicker that displays date in the format "dd MM yyyy HH:mm"

If jQuery 1.6.2 is used, hour : minute part is reset to zeroes on page load.

I've attached a sample project demonstrating it. Just go to the "About" page.

The expected value is "01 09 2011 16:40", but actual is "01 09 2011 00:00"

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 Sep 2011, 09:38 AM
Hello Oleg,

 
In order to show and work with Date and Time you will need to use DateTimePicker UI component. The datepicker currently serialize only date part of the DateTime object and thus the time part is lost.

Kind regards,
Georgi Krustev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Oleg
Top achievements
Rank 1
answered on 03 Sep 2011, 04:42 PM
Georgi,

The time part is not lost if I use jQuery 1.5 that is shipped with Telerik package, so serialization/desirialization of time works just fine.

The time part is only lost when I use jQuery 1.6.2.

It seems like it's a compatibility bug with newer version of jQuery.

Using Telerik DateTimePicker UI is not an option for me because of usability requirements.

Can you please check why jQuery 1.6.2 affects time part serialization?
0
Georgi Krustev
Telerik team
answered on 05 Sep 2011, 08:36 AM
Oleg,

As I mentioned in my previous reply the problem is not related with version of jQuery. The issue is caused by the serialized selectedValue, which has bigger priority then the input value. Check this screen-cast which I have made while testing your test project.
 

Regards,
Georgi Krustev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Oleg
Top achievements
Rank 1
answered on 06 Sep 2011, 07:15 PM
Thanks Georgi.

I followed your suggestion to use DateTimePicker instead, but have hidden the time picker button using following css, so I can use my own time picker control:
.t-icon-clock{display:none}
.t-datetimepicker .t-picker-wrap {padding-right: 28px;}

Do you foresee any problems with this approach?

Thanks,
Oleg
Tags
Date/Time Pickers
Asked by
Oleg
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Oleg
Top achievements
Rank 1
Share this question
or