Since working days differ per country and even per region, I would look for a source that takes this into account, for example a REST service. From this REST service you can retrieve the holidays and mark them as a non-working day. What you can also do is that you mark the holidays once a year and then you are ready for that year.
As for the weekend days, you can check for each day whether it is a Weekend-day or not, you can do this with the Format Date function available in Mendix: https://docs.mendix.com/refguide7/parse-and -format-date-function-calls
Look at the documentation here: https://docs.mendix.com/refguide7/parse-and-format-date-function-calls
You could use for non UTC dates this
formatDateTime([%CurrentDateTime%], 'EEE')
Or use the formatDateTimeUTC for the UTC dates. This will give you Fri, of Friday. See also this: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
So this way you can check which day of the week it is. And you can use addDays or addDaysUTC to add a day to get the next day.
Regards,
Ronald
First of all you would need to have some configuration/table in your application which would store all the holidays for the month/year.
Now with holiday day available in a table, in order to determine a weekend, which is saturday or sunday, you could use the following expression
parseInteger(formatDateTime(<date attribute>, 'u'))
which will return an integer with Monday=1 and Sunday=7
Combining the two logics you could solve your problem. Hope it helps.
I’m not sure how to go about adding a configuration table, that does sound like a good approach though. Is there a particular module I should use?
You can create a simple entity like below, along with overview and edit pages. You can fill in the holidays for that month and use this data in your microflow to determine whether that day is holiday or not.