Page 1 of 1

Generic generation of public holiday date tables

PostPosted: Tue Oct 20, 2015 5:12 pm
by Bernd.N
Sometimes you need the dates of public holidays like Christmas Eve. As soon as you need them for a lot of countries, you might not want to create the records manually each year by typing them in.

We created now a generic solution that can generate the needed records based on rules tables for each country.
It supports the holidays that depend on the Easter-Sunday-calculation, as well as fixed days (that's easy) plus rules like "4th Thursday in November", which is Thanksgiving in the USA.
For specific cases there are functions like USIndependenceDay(), which is on 4th of July but different when that falls on a weekend.

Also supported is a 1:n-table for holidays that are region specific.
As that is quite tricky for example for Switzerland, it is also possible to just choose the holidays one needs for a specific branch in Switzerland.

In case someone needs that for an application, just contact me via LinkedIn.

Re: Generic generation of public holiday date tables

PostPosted: Tue Oct 20, 2015 11:15 pm
by sbutler
Interesting. Sometimes its the little things that can be a lot of work, like when a customer says they want things based on "business days", which can be unique for each application. We use this approach: http://www.brianshowalter.com/calendar_tables and extended it to be multi-tenant, and added some custom MySQL function to simplify querying it. It can get tricky, because even 2 companies in the same country will have different rules for holidays, for example some get the holiday on the weekday before/after if it falls on weekends, and others not. So we auto-populate based on info provided by the customer, and then they manage their own holiday calendar from that point on.

Re: Generic generation of public holiday date tables

PostPosted: Tue Oct 20, 2015 11:48 pm
by Bernd.N
True, a general table with public holidays is just the base, and then a customer has to be able to create his own rules and edit it. SAP calls this calendar "Factory Calendar".
We also create our table of public holidays per tenant.