Constraint for working hours

Hi,
I am looking for the input to look like 8:00 a.m - 5:00 p.m
I tried to have in the constraint ```
regex(., '[1]|1[0-2]:[0-5][0-9] [ap].m. - [1-9]|1[0-2]:[0-5][0-9] [ap].m.

``` but it did not work. Kindly advise on the correct constraint to standardize the respondents' inputs on the working hours.
thanks

  1. 1-9 ↩︎

Hi @nour_alhajali and welcome back,

May I suggest you to use a time type question, with decimal-time constraints?

This post by Kal could help you:

2 Likes

Thanks a million for the explanation. I am looking for one question about the start and end working hours. In the above way, it will take two questions. If it is possible to kindly share the correct constraint syntax for the regex that will be greatly helpful.

1 Like

@nour_alhajali, Do you intend to use 12 Hour format e.g am - pm? Can you use 24 Hour format?

1 Like

sure, we can use any of them 12 or 24
but at the end the respondent can answer business hour question at once