How to limit the time showing in a DataTime field?

  • Profile Image
    Asked on June 07, 2016 at 03:56 PM

    Can I Limit Time?? I want time to display from 10:00 until 18:00.

    Is possible?

  • Profile Image
    Answered on June 07, 2016 at 05:32 PM

    Yes, it is possible. With the help of CSS codes, we will hide the options from 0:00 to 9:00 and 19:00 to 23:00.

    Please check this form:

    Here's the CSS code added to the form.

    select[id^="hour"].time-dropdown.form-dropdown option:nth-child(n+2):nth-child(-n+11){

    display: none !important;


    select[id^="hour"].time-dropdown.form-dropdown option:nth-child(n+21):nth-child(-n+25){

    display: none !important;


    Here's how it's done.



    I hope this helps. Let us know if you need any further assistance. Thank you.

  • Profile Image
    Answered on December 05, 2016 at 03:17 PM

    Hi Mike_G,

    You CSS code works well with Chrome.  but the hours limitation with your CSS doesn't work in Internet Explorer.  Could you provide the CSS for Interner Explorer as well?


    My form:



  • Profile Image
    Answered on December 05, 2016 at 05:37 PM

    Hey Martin, to give way to the OP, I have moved your question to a separate thread

    We'll have it addressed there shortly.