colombian-holidays

Colombian holidays

Usage no npm install needed!

<script type="module">
  import colombianHolidays from 'https://cdn.skypack.dev/colombian-holidays';
</script>

README

Colombian Holidays 🎆

npm version build and release codecov CodeFactor

TypeScript module to calculate colombian holidays for any given year.

Installation

To install as a dependency of your project:

npm install colombian-holidays

Usage

The module exports a single function that to get all the holidays for a given year, returning an array with the holidays for the requested year.

The year should be between 1984 and 4099.

CommonJS

const colombianHolidays = require("colombian-holidays").default;

ES6 Modules

import colombianHolidays from "colombian-holidays";

You get a function that you can use to get the complete list of holidays for a given year:

const colombianHolidays2015 = colombianHolidays(2015);

The content of the colombianHolidays2015 variable will be the following array:

[
  { date: '2015-01-01', celebrationDate: '2015-01-01', name: 'Año Nuevo', nextMonday: false },
  { date: '2015-01-06', celebrationDate: '2015-01-12', name: 'Reyes Magos', nextMonday: true },
  { date: '2015-03-19', celebrationDate: '2015-03-23', name: 'San José', nextMonday: true },
  { date: '2015-04-02', celebrationDate: '2015-04-02', name: 'Jueves Santo', nextMonday: false },
  { date: '2015-04-03', celebrationDate: '2015-04-03', name: 'Viernes Santo', nextMonday: false },
  { date: '2015-05-01', celebrationDate: '2015-05-01', name: 'Día del Trabajo', nextMonday: false },
  { date: '2015-05-14', celebrationDate: '2015-05-18', name: 'Ascensión del Señor', nextMonday: true },
  { date: '2015-06-04', celebrationDate: '2015-06-08', name: 'Corpus Christi', nextMonday: true },
  { date: '2015-06-12', celebrationDate: '2015-06-15', name: 'Sagrado Corazón de Jesús', nextMonday: true },
  { date: '2015-06-29', celebrationDate: '2015-06-29', name: 'San Pedro y San Pablo', nextMonday: true },
  { date: '2015-07-20', celebrationDate: '2015-07-20', name: 'Grito de la Independencia', nextMonday: false },
  { date: '2015-08-07', celebrationDate: '2015-08-07', name: 'Batalla de Boyacá', nextMonday: false },
  { date: '2015-08-15', celebrationDate: '2015-08-17', name: 'Asunción de la Virgen', nextMonday: true },
  { date: '2015-10-12', celebrationDate: '2015-10-12', name: 'Día de la Raza', nextMonday: true },
  { date: '2015-11-01', celebrationDate: '2015-11-02', name: 'Todos los Santos', nextMonday: true },
  { date: '2015-11-11', celebrationDate: '2015-11-16', name: 'Independencia de Cartagena', nextMonday: true },
  { date: '2015-12-08', celebrationDate: '2015-12-08', name: 'Inmaculada Concepción', nextMonday: false },
  { date: '2015-12-25', celebrationDate: '2015-12-25', name: 'Navidad', nextMonday: false },
]

If the year is omitted, by default the function will return the holidays for the current year:

const colombianHolidays = colombianHolidays();

TypeScript

The module is written in TypeScript and type definitions files are included.

Contributing

Contributions, issues and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

License

FOSSA Status