Date Validations

Hi,

I have used an expression “(int(format-date(today(), ‘%Y’)))” and it
returns me the year as “2012”. This is working fine as it returns the year
correctly.

I have a input field that is of type “Integer Number” and we have
incorporated the validation as “. >= 2005 AND . <=
(int(format-date(today(), ‘%Y’)))”, against this field. However, even if
we input 2024 or 2004, still it is accepted and no validation error is
given.

Kindly request your expert advise on this.

Warm Regards,
Jeffrey

Jeffery,

This is very odd, that is a pattern I’ve followed before and should
definitely be working.

I’ll take a look at this ASAP and give you a timeline.

What version of CommCare are you running?

-Clayton

··· On Tue, Jul 24, 2012 at 5:01 AM, Jeffrey Jose wrote:

Hi,

I have used an expression “(int(format-date(today(), ‘%Y’)))” and it
returns me the year as “2012”. This is working fine as it returns the year
correctly.

I have a input field that is of type “Integer Number” and we have
incorporated the validation as “. >= 2005 AND . <=
(int(format-date(today(), ‘%Y’)))”, against this field. However, even if
we input 2024 or 2004, still it is accepted and no validation error is
given.

Kindly request your expert advise on this.

Warm Regards,
Jeffrey