Restrict a date up to one year

When I am trying to develop XML form, I have to restrict a date up to one year from the date of birth. In this connection, I tried in the form int((today() - (${dob})) div 365.24) given to (${fieldname}<='6') in the calculate
and calculation part respectively but I am not getting what I expected.

Try something like this, where ${some_date} is the date that you want to restrict:

some_date: constraint='(decimal-date-time(.) - decimal-date-time(${dob})) <= 365'

See decimal-date-time() for details.

1 Like

Thank you very much Xiphware for your kind reply.