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

Datepicker setDate

1 Answer 52 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
guo yabin
Top achievements
Rank 1
guo yabin asked on 25 Aug 2009, 09:05 AM
Hi everyone,

If found something strange about the way setDate behaves when passing a date object in parameter.

I use the fonction like this:
var date = new Date();
alert(date); // Tue Aug 25 2009 16:58:26 CTU+0800
$('#datepicker).datepicker('setDate', date);
alert(date); // Tue Aug 25 2009 16:58:57 CTU+0800

Why does the setDate function modifies the date object? Is this normal?
How to modifiy format of the date ,eg 'yy-MM-dd'?
I didn't find anything about this subject on the website.

Thanks a lot

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 27 Aug 2009, 01:00 PM
Hello guo yabin,

Try with the RadDatePicker client API directly:

$find('RadDatePicker1').set_selectedDate(date);

where RadDatePicker1 is the ID of the picker.

All the best,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
DatePicker
Asked by
guo yabin
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or