Hi Everyone,
I'm sure this is an obvious question but how do I set a default time when a user selects a date.
I have 2 RadDateTimePicker controls on a page where the user selects a daterange.
When the user selects a From date I want to automatically set the time portion of the returned date to 0:00 and when the user selects a To date I want to default the time to 23:59.
What am I missing, surely there is a default Time property somewhere that controls the time portion of the date returned from the Calendar.
Many thanks
Antony
6 Answers, 1 is accepted
You can refer to the following code library submission which will help you set a default time to the RadDateTimePicker.
Set default time in RadDateTimePicker
Thanks
Princy.
To achieve the desired functionality, please review the following code library which elaborates on how to set default time value for a DateTime/TimePicker control.
Set default time in RadDateTimePicker
Regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Hi Princy,
Many thanks for the sample project, it does however have a rather obvious bug.
If the datepicker is empty and the user clicks on the TimePopup button and selects a time, the datepicker is set to Todays' date with the default time setting not the time the user selected.
Anyway I have learnt from the sample project and managed to fix it so that it now suites my requirements.
Many thanks
Antony
RadDateTimePicker control displays 12 AM as default time. If you want to change this default time following can help you out.
<TimePopupButton HoverImageUrl="" ImageUrl="" />
<ClientEvents OnDateSelected="DateSelected" />
<TimeView CellSpacing="-1" StartTime="07:00" EndTime="23:00" Interval="0:15:0" Columns="6" OnClientTimeSelected="ClientTimeSelected"></TimeView>
<Calendar skin="WebBlue" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
<DatePopupButton HoverImageUrl="" ImageUrl="" />
</telerik:RadDateTimePicker>