check on two dates

Hi,

created a form in Bonita studio (6.1.2) in which there is a date field Departuredate and another field Requestdate.
Now, if there is LESS than 30 days between Request and Departure, than i want to have a kind of blocking state so that the requester is forced to choose another Departureday.
Tried to create a script in Contingencies, but i am new with this tool and not really familiair with this.
Any ideas?!
Thnx
emveha

Hi.

You can do that with Form Validator.
In your form, in Validator tag, create a new Validator.
Choose a groovy expression.
In error message you type an error message (“The XDate need to be 30 days after YDate”).
In parameter you need to add a groovy script. Something like :

return !(field_Date1<field_Date2+30);

It’s done.