Hi,
In the date field, for the calender I want to make the weekends as disbaled (non selectable) whereas the week days should be selectable. is it possible to do this in a!datefield?
Discussion posts and replies are publicly visible
Nope. It is not possible. But a good work around will be to show instructions below the field and add a validation.
To validate should we use calisworkday function?
Yes you can.
Just know that calisworkday does not include week days marked as holidays.
Otherwise, another easy way to do this is to use the text() function and check for MON/TUE/WED/THU/FRI.
I have a field in the interface in which I select the dates using the a!datefield. In that case, I am not use how can we use the text(). When I use the below, I am getting an error, Expression evaluation error at function fn!calisworkday : A null parameter has been passed.
validations: if( fn!calisworkday(my field name) =true, true, "select a weekday"
You need to add a null check
a!localVariables( local!date, a!dateField( label: "Date", value: local!date, saveInto: local!date, validations: if( and( a!isNotNullOrEmpty(local!date), not(calisworkday(local!date)) ), "You have to select a weekday", "" ) ) )
Thanks for your help, it worked