Command for disallowing Future Date in xls forms

Dear All,
I am Samuel from Ghana and a member of the ODK community. I am currently designing a form and went to set the date such that some one can not enter future date or previous date but today.

I know the command for today as . = today() at constraint. I kindly need you help members to fix this. and also a command to set the current time not ealiar or future time

Kind regards
Samuel ofori Gyasi

ITS DEPENDENT ON UR FONE SETTINGS

I mean in the designing process, how can i write that command so that someone is not allowed to set future date or a date ealier but only today.

Have you tried this? To constrain a date to today() you would use:

${Date}: constraint = ". = today()"

Although if the user always has to enter today, one has to ask why have a question for it; why not instead simply put today() as a calculated result...

2 Likes

Thank you very much for the update. i will try it

Enter .<= today() under constraint. This will disallow entering future dates.

3 Likes