Display and select the hours and minutes separately in RadDateTimePicker

7 posts, 0 answers
  1. Ashbin
    Ashbin avatar
    6 posts
    Member since:
    Oct 2014

    Posted 15 Mar 2017 Link to this post

    Hi 

    Is it possible for the RadDateTimePicker to display and select the hours and minutes separately?
  2. Ashbin
    Ashbin avatar
    6 posts
    Member since:
    Oct 2014

    Posted 15 Mar 2017 Link to this post

    when select the date & time for rad date time picker– Is it possible to select minutes in Time picker.
  3. JeffSM
    JeffSM avatar
    42 posts
    Member since:
    May 2014

    Posted 22 Aug 2018 Link to this post

    How display only HH:mm and how to put time: "14:93" for example!
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4931 posts

    Posted 24 Aug 2018 Link to this post

    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.
  5. NETSI
    NETSI avatar
    1 posts
    Member since:
    Apr 2019

    Posted 10 Jun in reply to Marin Bratanov Link to this post

    I think the original question was if you can have 3 popups in total. One for date, one for hours and one for minutes.
  6. JeffSM
    JeffSM avatar
    42 posts
    Member since:
    May 2014

    Posted 10 Jun in reply to JeffSM Link to this post

    93 was a typo. Should be 03.
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4931 posts

    Posted 11 Jun Link to this post

    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.
Back to Top