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

Display and select the hours and minutes separately in RadDateTimePicker

6 Answers 257 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Ashbin
Top achievements
Rank 1
Ashbin asked on 15 Mar 2017, 05:47 AM
Hi 

Is it possible for the RadDateTimePicker to display and select the hours and minutes separately?

6 Answers, 1 is accepted

Sort by
0
Ashbin
Top achievements
Rank 1
answered on 15 Mar 2017, 10:38 AM
when select the date & time for rad date time picker– Is it possible to select minutes in Time picker.
0
JeffSM
Top achievements
Rank 2
Veteran
answered on 22 Aug 2018, 09:09 PM
How display only HH:mm and how to put time: "14:93" for example!
0
Marin Bratanov
Telerik team
answered on 24 Aug 2018, 03:47 PM
Hi,

The RadDateTimePicker allows you to select the time and date separately through two popups. If you select only the time, however, it needs to populate the date as well, and it chooses the current date unless something else is specified. If you want to have both components separate, you can put a date picker and a time picker next to each other. For example:

<telerik:RadDatePicker runat="server" ID="rdp1"></telerik:RadDatePicker>
<telerik:RadTimePicker runat="server" ID="rtp1"></telerik:RadTimePicker>
<asp:Button Text="get date and time" ID="btn1" OnClick="btn1_Click" runat="server" />
<asp:Button Text="set time" ID="btn2" OnClick="btn2_Click" runat="server" />
protected void btn1_Click(object sender, EventArgs e)
{
    Response.Write(string.Format("selected date: {0}<br />selected time: {1}", rdp1.SelectedDate, rtp1.SelectedTime));
}
 
protected void btn2_Click(object sender, EventArgs e)
{
    rtp1.SelectedTime = new TimeSpan(10, 11, 12);
}

On a side note, the time 14:93 is not valid, because it is not a valid TimeSpan value, since hours can only contain up to 60 minutes.

Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
NETSI
Top achievements
Rank 1
answered on 10 Jun 2019, 04:30 PM
I think the original question was if you can have 3 popups in total. One for date, one for hours and one for minutes.
0
JeffSM
Top achievements
Rank 2
Veteran
answered on 10 Jun 2019, 04:59 PM
93 was a typo. Should be 03.
0
Marin Bratanov
Telerik team
answered on 11 Jun 2019, 05:37 AM
Hello,

@Jeff - I suspected as much, but I had to note it, that's why it was at the end as an aside note.

@Hector - Perhaps you could use two time pickers with templates so you can show what you want them to show: https://demos.telerik.com/aspnet-ajax/timepicker/functionality/timeview-templates/defaultcs.aspx. Their input would still show both hours and minutes, though. If you want such granular choice, I suggest you also consider simple dropdowns for that - a dropdown with 12 elements for hours, and a dropdown with 60 elements for minutes.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DateTimePicker
Asked by
Ashbin
Top achievements
Rank 1
Answers by
Ashbin
Top achievements
Rank 1
JeffSM
Top achievements
Rank 2
Veteran
Marin Bratanov
Telerik team
NETSI
Top achievements
Rank 1
Share this question
or