business
business copied to clipboard
Add extra_holidays key when creating a Calendar
In some countries, like Poland, when a public holiday occurs on a
Saturday, the employer has to pick a working day which will be a
holiday. Adding extra_holidays
key will allow people to adjust to
things like that on a per-case basis.
@danielroseman I'm not sure if this isn't out of scope but I thought it would be a good idea to allow people to add extra holidays when they use a predefined calendar. WDYT?
From this diff, I (a fellow library user, not a maintainer) don’t see what extra_holidays
provides that holidays
doesn’t already provide. I think it would be simpler for your code that creates a Business::Calendar
to add your extra holidays to the array passed as the holidays
parameter:
STANDARD_HOLIDAYS = ['2022-12-24', '2022-12-25']
HOLIDAYS_OBSERVED_ON_WEEKDAYS = ['2022-12-23', '2022-12-26'] # what you called extra_holidays
Business::Calendar.new(holidays: STANDARD_HOLIDAYS + HOLIDAYS_OBSERVED_ON_WEEKDAYS)