Date field client script - Atleast 3 business days out

jna2756
Tera Expert

Hi,

I am trying to create a client script that will run against a Date variable that will only let end users select days at least 3 business days in the future. I was able to create one that will at least 3 days in future but they are still able to select days during the weekend.

Currently, I am able to achieve this by grabbing the day they selected and comparing it to a future date (today's date + # of days) and clearing the field if it is not enough days out.

Any Ideas?

Thanks,

Josh Anderson

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

The way I do it, without getting into schedules, is to get the day of week value (for example, 4 is Thursday).   Then, if day of week value + 3 > 6 (which is Saturday), I add 5 instead of three.


View solution in original post

7 REPLIES 7

Mike Allen
Mega Sage

The way I do it, without getting into schedules, is to get the day of week value (for example, 4 is Thursday).   Then, if day of week value + 3 > 6 (which is Saturday), I add 5 instead of three.


Thanks Mike, it works perfectly! I greatly appreciate it.


sanuj
Kilo Contributor

Can you please provide the code for this.even i have a same requirement.


Hi Sanuj,



See my response to Dilini below...



Thanks,


Josh