Xpage Date Field validation

I have a date control on a XPage. I am trying to specify the Minimum and Maximum for validation.

If I use a static values like 2011/01/01 00:00:00

it works fine. But I need to compute the maximum and minimum dates (in my case within a specific year)

What format should the date be in for the computed value? If I create a string in the JavaScript just like above, I get a parse error at run-time.

Subject: found a solution/ further question

By using SSJS like @Date(“01/01/2010”) as the computed minimum or maximum.In my case it was something like

@Date(“01/01/”+viewScope.Year.toString());

My follow up question is on more complicated validation for dates.

Where and how can I do more complicated Validation that just a single date range?

Based on other items this date can’t be in several ranges, so I can just provide a simple range to validation. In a way similar to Meeting Scheduling. It needs to be with with a open slot.