Time control

4 posts, 0 answers
  1. Jaymie
    Jaymie avatar
    57 posts
    Member since:
    Jan 2009

    Posted 19 May 2010 Link to this post

    So, here goes.

    I have a user requirement. The basically need 1 textbox, it doesnt matter if it is a masked textbox or a datetimepicker or whatever.
    This textbox needs to allow only hh:mm and when it gains focus it needs to select the whole of the contents.

    When the user navigates to this textbox initially, it should be blank (it can be __:__ if masked) and should allow a user to type:


    without needing to press any other keys (01 is the hours and 25 is the minutes). The control should be smart enough to display 01:25 but not require the user to press the arrow keys to move from hours to minutes.

    I have tried this using the maskededitbox and found that it doesnt work as intended and I cant clear the text if I set the mask to ##:## which is annoying. I then used the datetimepicker and selected time, but it has hh:mm:ss and to get from hours to minutes you have to use the arrow key.

    Any help you can give would be greatly appreciated.
  2. Deyan
    Deyan avatar
    2147 posts

    Posted 25 May 2010 Link to this post

    Hello Jaymie,

    Thanks for contacting us and for the details on your case.

    Currently, RadMaskedEditBox does not fully support the described behavior. You can set the MaskType to DateTime and set the Mask to HH:MM. This will restrict the input only to valid time in 24 hour format. However, you cannot show '_' placeholders in this case.

    Also, when typing you should manually switch to the minutes part of the input to edit it. The control does not automatically do this out of the box.

    Since your requirements are interesting, we will put them in our TODO list and will try to implement them as soon as possible. You can track the status of this request via our Public Issue Tracking System:

    Do not hesitate to write back in case you have further questions or need assistance.

    Kind regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Ali
    Ali avatar
    1 posts
    Member since:
    Jan 2017

    Posted 30 Jan in reply to Deyan Link to this post

    Try this

        <input id="datepicker2" />
          $(function() {

            //combine MaskedTextBox with DatePicker (officially unsupported)
            var datepicker2 = $("#datepicker2");

              mask: "00:00"

              interval: 15,
              format: "HH:mm",
              parseFormats: ["HH:mm"]


  4. Dess
    Dess avatar
    2172 posts

    Posted 31 Jan Link to this post

    Hello Ali,

    Thank you for writing.  

    I would like to note that this forum is related to the Telerik UI for WinForms suite. Please post your technical questions/replies in the relevant forum: http://www.telerik.com/forums

    Thank you for your understanding.

    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top