RadDateTimePicker default time

7 posts, 1 answers
  1. Antony
    Antony avatar
    57 posts
    Member since:
    Oct 2008

    Posted 27 Apr 2009 Link to this post

    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


  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Apr 2009 Link to this post

    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

  3. Pavlina
    Pavlina avatar
    6187 posts

    Posted 28 Apr 2009 Link to this post

    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

    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.
  4. Antony
    Antony avatar
    57 posts
    Member since:
    Oct 2008

    Posted 29 Apr 2009 Link to this post

    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


  5. Eliza Sahoo
    Eliza Sahoo avatar
    29 posts
    Member since:
    Jan 2010

    Posted 08 Feb 2010 Link to this post

    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="" />

  6. Developer
    Developer avatar
    16 posts
    Member since:
    Jun 2009

    Posted 24 Feb 2010 Link to this post

    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.

  7. Donald McLean
    Donald McLean avatar
    29 posts
    Member since:
    May 2010

    Posted 12 Jul 2018 in reply to Developer Link to this post

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