Cognito-forms – cognito forms Calendar calculation for every other wednesday

cognito-forms

I a using Cognito forms to have people register for an event which occurs every other Wednesday.

How can I get the calendar function to not allow registration for any other days of the week (Mon, Tues, Thurs, Fri, Sat, Sun)

And also only allow registration on every other wednesday?

Thank you

Best Answer

To see if it was Wednesday use the calculation

=(DateField.DayOfWeek = "Wednesday")

To only allow for every other week use

=(Math.Floor(DateField.DayOfYear/7)%2 = 1)

To only allow for every other Wednesday use

=(DateField.DayOfWeek = "Wednesday") and (Math.Floor(DateField.DayOfYear/7)%2 = 1)

If that is the wrong week, change the 1 to 0 and the end.