Generic generation of public holiday date tables

Share business templates, ideas, experiences, etc with fellow Servoy developers here

Generic generation of public holiday date tables

Postby Bernd.N » Tue Oct 20, 2015 5:12 pm

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.
Attachments
holidayUSA.jpg
holidayUSA.jpg (182.44 KiB) Viewed 669 times
holiday generation.jpg
holiday generation.jpg (632.33 KiB) Viewed 669 times
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 477
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: Generic generation of public holiday date tables

Postby goldcougar » Tue Oct 20, 2015 11:15 pm

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.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 657
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Generic generation of public holiday date tables

Postby Bernd.N » Tue Oct 20, 2015 11:48 pm

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.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 477
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Sharing Central

Who is online

Users browsing this forum: No registered users and 3 guests

cron