I am trying to figure out a way to generate first and last business day for each week between two dates for example 2016-01-01
and 2017-02-28
.
Considering there are many weeks in US where we have long weekend starting on Friday
or extending to Monday
, finding all dates with Monday and Friday is not a working logic. For weeks where Monday
is holiday, Tuesday
would be first business date and if Friday
is holiday, Thursday
will be last business date.
I can use pandas date_range
function to generate all days between two dates but beyond that I can't seem to figure.