Heey Ben,
A while back i uploaded a module to the appstore that can do this for you.
Take a look at https://appstore.home.mendix.com/link/app/110117/
Kind regards,
Edo
You could also do it by logic thinking.
Step 1, calculate the amount of full weeks you have in the period, and multiply this with 5.
– (daysBetween($StartDate,$EndDate) – (daysBetween($StartDate,$EndDate) mod 7) div 7)*5
Step 2, find out which days are in your remainder (because you could have not full weeks)
– Create a variable with the number of remainder days: daysBetween($StartDate,$EndDate) mod 7.
– The rest could be done in the microflow like this.
EDIT: Damn, forgot to plus the counter. So before “change Variable” also add 1 to the counter variable.
Step 3: Now just add those two numbers, and you have the amount of non-weekend days. (Ofcourse now you have holidays included, but the question said excluding weekends :) )
The following worked for me:
floor(daysBetween(Start,End) - floor(daysBetween(Start,ENd) div 7) - floor(daysBetween(Start,End) div 8))