Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Take a look at the brg attached. It does the following.
- Expects a parameter with the month name, spelled complete, e.g. January. You did not specify if there was a year given in your graph parameter, so I presumed there was not and I used the current year to work out the exact month that was to be calculated, e.g. January 2020 has different work days to January 2021.
- There is a parameter called Holidays where you can enter a list of dates that you want recognized as Holidays and not work days, outside of Saturday and Sunday. Enter these days in the format YYYY-MM-DD and have one per line.
- The Filter node will first translate January to 1, February to 2 etc and attach the current year to it. Then then first and last date of the month is calculated from it.
- The first while loop will cycle through the entire month and add a count to either workday_count or nowork_count, depending on if the day is a weekend (Saturday and Sunday) or not.
- The second while loop will cycle through all of the Holiday values listed in the graph parameter and subtract a day from the workday_count value and add a value to nowork_count value, if the Holiday falls in the same year and month.
Attached files
WorkDayMonth.brg