Hi all i want to restrict the choosable date in the date picker to a predetermined day of the week. For example the earliest date the user can pick is the following wednesday and then every wednesday after that.
(For Saturday and Sunday add 86400 to the last value in the list)
Next you need to know how many seconds are in a week:
86400*7 = 604800
What I did is store the chosen day as a Global Value in seconds (Weekday in seconds)
I was unable to restrict choices to just the chosen day however i was able to set the first available date to the next occurrence of the chosen day (i.e the next wednesday)
To do this I needed to use the following formulas:
Start of Frame + WeekDay in Seconds < 604800-(day of week of( "Date & Time" )*((60*60)*24))
Set Minimum allowed date of Date Picker to - Date Add$( "Calendar Object", System Date$( "Calendar Object" ), (WeekDay in seconds-day of week of( "Date & Time" )*((60*60)*24)))
Start of Frame + WeekDay in Seconds > 604800-(day of week of( "Date & Time" )*((60*60)*24))
Set Minimum allowed date of Date Picker to - Date Add$( "Calendar Object", System Date$( "Calendar Object" ), 604800-(day of week of( "Date & Time" )*((60*60)*24))+WeekDay in seconds)
Start of Frame + Weekday in seconds = 604800-(day of week of( "Date & Time" )*((60*60)*24))-86400
Set Minimum allowed date of date picker to Date Add$( "Calendar Object", System Date$( "Calendar Object" ), 604800)
the first 2 formula mean if it is Monday the first available date is 2 days later. If it is Thursday then the next date is Wednesday the week after.
The last formula just adds a week on if it is wednesday.
Posted this just in case someone else is ever in need of a solution to this problem