Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including swedish-holidays-ts with all npm packages installed. Try it out:

import { getHolidays, getUpcomingHolidays, isHoliday, language, } from "swedish-holidays-ts"; // Get an array of all holidays for the current const holidays = getHolidays(); // Get an array of all holidays for a specific year const holidays2019 = getHolidays(2019); // Get an array of all upcoming holidays const upcoming = getUpcomingHolidays(); // Check if today is a holiday const isItAHolidayToday = isHoliday(); // Or if you want to check a specific date const isThisAHoliday = isHoliday(new Date("2019-12-24")); // Create a translation const translation = { ...language }; translation.christmasEve = "Christmas Eve"; // Get an array of holidays with applied translation const holidays2020 = getHolidays(2020, translation);

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

swedish-holidays-ts v1.0.2

Typescript library for calculating the date of all swedish holidays for any given year.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free