Allow to select only Specific Time

Team,

We have to ask the user to enter his schedule during working hours. How can we control users who should not enter non-working hours in it? For Example, we only want to allow users to choose time from 08:00 AM to 08:00 PM.

If we put validation and hide it then it is not enforcing users. Please guide.

Hi,

You can follow these steps to get the validation working.

  • Use 2 numeric control to store unix of 8AM (i.e. value as 28800000) & 8PM (value as 73800000)
  • Use 1 numeric control to pass timepicker’s reference.
  • Now, if timepicker is less than 8AM or greater than 8PM, I show an input label which says - “Please enter valid time”.
  • That is, I would configure in Rules that if numeric value representing timepicker is less than 8AM unix or greater than 8PM unix, I show input label else I hide input label.
  • And then in validation, I apply that, input label should not be equal to “Please enter valid time”

Hope this helps.

Hi @kundan.jha ,

We also have a new property in Date and Time controls to setup local time for the values.
I have a feeling with those values you should be able to get the desired result without doing the workaround that Chirag suggested.

Let me know if it works.

DronaHQ Docs have found a new place!

We have updated and moved our documentation to docs.dronahq.com.
You can continue to ask questions in the community here.