Holiday Import from iCal Files

May 10, 2022 | General

SIGNL4 offers powerful duty scheduling and time-based overrides for routing alerts to the right people at the right time.

With time-based overrides for example, you can apply different alerting workflows during business hours, weekends, holidays, etc. Holidays in general can bring other requirements for signaling and must also be considered separately when planning shifts.

You can add and edit holidays manually in SIGNL4 or you can import them from iCal files. For the latter we provide a sample script here and you only need an iCal (.ics) file containing your local holidays. You can get these from the Internet or from third-party systems.

Usage and Sample Code

Attention: This code is intended as a sample and as a starting point for your own implementation. It is provided with no guarantee. Please use with care.

Attention 2: Existing holidays will be overridden.

We provide a sample Node.js script for importing holidays from a .ics file. The sample file uses the SIGNL4 REST API as documented here: https://connect.signl4.com/api/docs/index.html

You can find the import script as well as additional information on GitHub.

As a prerequisite you first need to install Node.js as described here.

The sample code is provided in the file ‘holiday-import.js’. You can execute the wile with the node command. The file takes the path to the .ics file as an argument.

Command line sample:

    node holiday-import.js C:\holidays.ics

This will import the holidays from the specified file.

You can also clear all holidays from the current and from the following year by using the following call:

    node holiday-import.js CLEAR

Within the source file you need to adapt the SIGNL4 API key and the team name:

const strAPIKey = 'YOUR-SIGNL4-API-KEY';
const strTeamName = 'Super SIGNL4';

You can create the API key in your SIGNL4 web portal under Teams -> Developer.

The command line execution returns result information about success or failure from the API call.

iCal File

The iCal (.ics) file contains the holidays to be imported. You can find those files containing your local holidays in the Internet.

You can adapt the script according to your needs.