I have a survey that will be for the public that will allow them to enter a date but I would like to restrict dates that can be entered to the current date or earlier. Based on the answer to this previously asked question, using the today() function will not consistently work. I have tried using format-date to get the current date and the entered date in a consistent format and then subtract the entered date from the current date. The constraint would be that if the result is a negative value, it would a future date and thus not accepted. I'm able to get the date conversions to work correctly but I can't get the constraint part to work. I've added a Calculate type field and have the calculation as
${converted_current_date} - ${converted_date_of_sighting}
I've added .<0 to the constraint field for the Calculate field. When I test it, any date I enter receives the constraint message.
I'm new to Survey123 Connect and I'm not sure what I'm doing wrong - is the logic of my constraint faulty? Do I have the constraint in the correct field?
