Date validation to specific day of the week in the past


Is it possible to limit a date field to a specific day of the week in the past. We’d like to build a date validation to only accept Fridays in the past. Is this possible? Any thoughts?



Yes, this is possible - you can use format-date to get the day of the week as an integer. Sunday is 0, so Friday is 5. This should work for your validation condition:

format-date(#form/your/question, “%w”) = “5”

You can also use “%a” or “%A” as that second argument to return “Fri” or "Friday, respectively. I believe that changes depending on the language though, so I’d advise using “%w” for an integer value.

1 Like

Thank you @Ethan_Soergel