How to Calculate days with startdate and end date

0
In my app there is constraint that I have to calculate the week days excluding saturday and sunday  I have tried this in microflow using this expresion on change object round(daysBetween($DayOffRequest/StartDate, $DayOffRequest/EndDate))+1- round(daysBetween($StartDate,$EndDate)(mod 7)(div 7)*5)) suggest me the right way?
asked
3 answers
0

 

I think you may try this-; round(daysBetween($DayOffRequest/StartDate, $DayOffRequest/EndDate)) + 1 - (round(daysBetween($DayOffRequest/StartDate, $DayOffRequest/EndDate) mod 7) div 5) * 2round(daysBetween($DayOffRequest/StartDate, $DayOffRequest/EndDate)) + 1 - (round(daysBetween($DayOffRequest/StartDate, $DayOffRequest/EndDate) mod 7) div 5) * 2
 

 

 

 

 

answered
0

Isn’t there a java action in the Appronto common module which does that?

https://marketplace.mendix.com/link/component/993

answered
0

As Lukas says, use the java action WorkdaysBetween.java from the Appronto Common module. If you’d rather implement this in a microflow, you will have to respect the day of week of the start date. You can get some ideas about implementation here: 

https://stackoverflow.com/questions/43541944/fastest-algorithm-to-calculate-the-number-of-business-days-between-two-dates

 

answered