Rank: Newbie Groups: Member
Joined: 3/19/2008 Posts: 2
|
Is there a way to change the default time when a date is selected on the calendar and the PickerFormat is set to MM/dd/yyyy hh:mm:ss tt? Right now it defaults to 12:00:00 AM but it would be nice to modify that on a per instance basis so the end user can have a reasonable default.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi, This is possible but requires some JavaScript programming. You would handle the date picker's ClientSideOnSelect event and change the value there:
Code: HTML/ASPX
<eo:DatePicker runat="server" id="DatePicker1"
ClientSideOnSelect="on_select_handler" ...>
....
</eo:DatePicker>
Code: JavaScript
function on_select_handler()
{
//Get the selected value
var date = DatePicker1.getSelectedDate();
//Create a new date value based on the
//selected value and apply the default time
var newDate = new Date(
date.getFullYear(), date.getMonth(), date.getDate(),
1, 2, 3); //Default time: hour, minute and second
//Change the date picker's value
DatePicker1.setSelectedDate(newDate);
}
Thanks
|
Rank: Newbie Groups: Member
Joined: 3/19/2008 Posts: 2
|
Worked great. Thanks for the quick reply.
|