This is a migrated thread and some comments may be shown as answers.
DatePicker
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Rathan
Top achievements
Rank 1
Rathan asked on 25 Jun 2012, 11:02 AM

HI,


     This is Rathan .Am using the Datetime picker control, i want to  assign the data from variable  to datepicker control using javascript function like below.
  var expdate= t_day+"/"+t_month+"/"+t_year ;
Here i want  to bind the above variable data to date pickercontrol in javascript function.
so please let me know .


Thank you .

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 25 Jun 2012, 12:59 PM
Hello Rathan,

You would do something like so:

var expdate = new Date(t_year, t_month - 1, t_day);
$find("<%=RadDatePicker1.ClientID%>").set_selectedDate(expdate);

I subtract the month by 1 as the Date contructor only accepts values from 0 - 11, where 0 is January.

I hope that helps.
Asked by
Rathan
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or