5 Answers, 1 is accepted
0
Hello Hoc,
Please note that set_selectedDate property accepts Date object.
For more information about the Date object, please examine the following link:
JavaScript Date Object
Best regards,
Daniel
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Please note that set_selectedDate property accepts Date object.
radStartTime.set_selectedDate(
new
Date(year, month, day, hours, minutes, seconds, milliseconds));
For more information about the Date object, please examine the following link:
JavaScript Date Object
Best regards,
Daniel
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Minh
Top achievements
Rank 1
answered on 03 Feb 2010, 06:14 AM
Dir Daniel,
If
If
radStartTime.set_selectedDate(
new
Date(MM/dd/yyyy hh:mm));
is ok?
Thanks for support,
Brgs,
0
Shinu
Top achievements
Rank 2
answered on 03 Feb 2010, 12:46 PM
Hello,
If you want to set the DateFormat from client side, then use the following client side code.
client side code:
Also checkout the documentation: RadDateTimePicker Client Object . I hope you will find this as useful.
-Shinu.
If you want to set the DateFormat from client side, then use the following client side code.
client side code:
var datetimePicker = $find("<%=RadDateTimePicker2.ClientID%>"); |
datetimePicker.get_dateInput().set_dateFormat("MM/dd/yyyy"); |
datetimePicker.get_dateInput().set_displayDateFormat("MM/dd/yyyy"); |
-Shinu.
0
Hello Hoc,
As explained in W3Schools there are four ways to instantiate a Date object:
new Date() // current date and time
new Date(milliseconds) //milliseconds since 1970/01/01
new Date(dateString)
new Date(year, month, day, hours, minutes, seconds, milliseconds)
Note that most of the parameters are optional - for example, if you pass the date part only, the next four parameters (time) will be set to 0 (default value).
Regards,
Daniel
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
As explained in W3Schools there are four ways to instantiate a Date object:
new Date() // current date and time
new Date(milliseconds) //milliseconds since 1970/01/01
new Date(dateString)
new Date(year, month, day, hours, minutes, seconds, milliseconds)
Note that most of the parameters are optional - for example, if you pass the date part only, the next four parameters (time) will be set to 0 (default value).
Regards,
Daniel
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Roshil
Top achievements
Rank 1
answered on 23 Jul 2011, 07:35 AM
Hi Daniel,
I have the following script
When i select a date from datetime picker, it is not showing any date and time,the raddatetime picker's textbox is empty.
Please help me on this issue.
I have the following script
function DateSelectedFirstPref(sender, args) {
if (!isTimeSelected) {
var val = "08:00:00";
var dateString = sender._dateInput._initialValue;
var month = dateString.split("/")[0];
var day = dateString.split("/")[1];
var yearTime = dateString.split("/")[2];
var year = yearTime.split(" ")[0];
sender.set_selectedDate(new Date(year, month, day, val.split(":")[0], val.split(":")[1], val.split(":")[2], 0));
}
}
When i select a date from datetime picker, it is not showing any date and time,the raddatetime picker's textbox is empty.
Please help me on this issue.