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

RadDateTimePicker default time

6 Answers 451 Views
Input
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 27 Apr 2009, 01:40 PM

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

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 27 Apr 2009, 02:08 PM
Hello Antony,

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.
0
Pavlina
Telerik team
answered on 28 Apr 2009, 06:11 AM
Hi Antony,

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.
0
Antony
Top achievements
Rank 1
answered on 29 Apr 2009, 01:43 PM

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

0
Eliza Sahoo
Top achievements
Rank 1
answered on 08 Feb 2010, 12:41 PM

RadDateTimePicker control displays 12 AM as default time. If you want to change this default time following can help you out.

<telerik:RadDateTimePicker ID="RadDate" Runat="server" Skin="WebBlue" >
<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>

thanks
0
Developer
Top achievements
Rank 1
answered on 24 Feb 2010, 04:41 PM
Thanks Eliza,

But that does not solve the problem, the code by Pavlina is exactly what I wanted, that project explains it neatly. The web-ui has the correct method, though.


Regards.
0
Donald McLean
Top achievements
Rank 2
answered on 12 Jul 2018, 06:40 PM
You are so right, I was having issues to and I saw the code that Eliza posted from a different site and it didn't work, however the code by Pavlina worked beautifully and saved my but.
Tags
Input
Asked by
Antony
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pavlina
Telerik team
Antony
Top achievements
Rank 1
Eliza Sahoo
Top achievements
Rank 1
Developer
Top achievements
Rank 1
Donald McLean
Top achievements
Rank 2
Share this question
or