I also had the requirement to calculate a date by adding a number of business days to a start date. Weekends and holidays must not be counted.
I found a solution using Nintex out-of-the box actions only. As this is a quite frequent requirement, I wanted the solution to be reusable. So I clicked together a Nintex User Defined Action to share it.
You may download the User Defined Action for free from www.dox42.com/WorkflowUtils.aspx
The User Defined Action takes a start date and a number of business days as input parameters and returns the due date.
The algorithm basically loops though all dates for two weeks from the start date and counts down the business days.
To test for a weekend it uses “fn-FormatDate({WorkflowVariable:testDate},ddd)”to see if it’s a Saturday or Sunday.
To find a holiday it queries a Sharepoint list named “Holidays” which must contain the Title, Day, Month, Year and a Boolean Field “Annual” for each holiday. For annual holidays like New Year’s Eve the year is ignored. I would have preferred using the Nintex managed holidays, but couldn’t find a way to access the values using the Nintex query list action.
Managing holidays in a list takes a little effort, but finally it took me 20 minutes to look up the movable holidays for the next couple of years and enter them to the list - good to go. The reward is that you can manage local and organization-specific holidays as well.
Cheers
Christian Bauer
www.dox42.com