Date validation Condition (Current month)

Hi all,

How can I create a validation condition for date entry, so that the mobile worker can only enter dates from the current month and not from past or future months?

You can use the format-date() function to check for comparison. Something like

format-date(now(), "%Y-%m") = format-date( date(#form/user_input), "%Y-%m")

should only return true when the #form/user_input question has a Year and Month that matches the current one.

1 Like