Public Holiday Toolkit v1.0

Today I’m proud to publish the Public Holiday Toolkit. To give you a short summary. Using this toolkit enables you to show public holidays for several countries within your .NET application. This can be interessting for many use cases. Think about calendars, appointments and so on.

What does the Toolkit offer?

The Public Holiday Toolkit comprises the holiday ruleset for Germany, New Zealand, Norway, Austria, Poland, Swiss, United Kingdom and the USA including all administrative districts. Furthermore it comprises an API for accessing the public holiday definitions, an Example Application and a Holiday Editor to create new rulesets for other countries.

How can I use it?

The holiday API is quite simple and contains only 4 methods.

/// <summary>
/// This class encapsulates all business methods to work with public holidays.
/// </summary>
public interface IHolidayService
    /// <summary>
    /// Loads a list with all countries and their public holiday definitions.
    /// </summary>
    List<Country> GetHolidayDefinitionsFromXml(string xmlFile);
    /// <summary>
    /// Saves a list with countries and their public holiday definitions.
    /// Existing files will be overwritten and replaced by the new holiday definition.
    /// </summary>
    void SetHolidayDefinitionsToXml(string xmlFile, List<Country> countries);
    /// <summary>
    /// Searches a specific country and district object for their public
    /// holidays within a given time frame. The result is not the holiday class
    /// itself, but a proxy object that contains the holiday definition.
    /// This is because holidays can be occure more than onces, if the
    /// timeframe covers more than one year.
    /// </summary>
    List<HolidayEntry> SearchHolidays(Country country, District district, DateTime startRange, DateTime endRange);
    /// <summary>
    /// Searches the weekends for a given time frame.
    /// </summary>
    List<HolidayEntry> SearchWeekends(DateTime startRange, DateTime endRange);

Do you have an example ?

Sure. An example application is provided within the download of the Public Holiday Toolkit. It’s only a small application, but it shows how to read the holiday definitions and show them within your application.

Public Holiday Toolkit Demo Application

What about creating public holiday definitions for other countries?

If you need to create or update public holiday definitions you can use the Holiday Editor within the Toolkit. The Holiday Editor enables you to modify the Holiday Definitions. I would be very glad if you could share new or updated holiday definitions with me and the public. Please send your created holiday definitions to me and I will publish them on this blog.

Here’s a screenshot of the Holiday Editor.

Holiday Editor

Where can I get it?

Simply download the Public Holiday Toolkit from the following location:

What else do I have to know?

The Public Holiday Toolkit uses the AdFactum ObjectMapper .NET in order to store and read the public holiday definitions. License informations about the AdFactum ObjectMapper .NET can be found here.

What’s left?

For now? Nothing. Feel free to use the holiday definition file and service component within your .NET application. As I already said: I would be happy If you could share some new holiday definitions of other countries with me.

– Gerhard

kick it on

One Response to “Public Holiday Toolkit v1.0”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 108 other followers

%d bloggers like this: