Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Extralight and no dependencies module to get Colombian holidays.
Getting Colombian holidays is a little bit tricky because there are three types of holidays:
To install as a dependency of your project:
npm install pascua
To load it on the browser you can use unpkg
, just add the following script. The pascua
object will be available globally.
Pascua include two functions: getHoliday
y getAllHolidays
.
The getHoliday
function allows to check if a given date is a holiday. It takes as an optional argument a JavaScript date and returns the name of the holiday in case the date is a holiday, or an empty string (""
)if it isn't.
const { getHoliday } = require('pascua')
const date = new Date('13-04-2017')
const holiday = getHoliday(date)
console.log(holiday)
// 'Jueves Santo'
If the date is ommited, by defaul the function is going to use the current date.
The function getAllHolidays(year)
allows to get all the holidays for a given year, returning an array with the holidays for the requested year:
const { getAllHolidays } = require('pascua')
const holidays2010 = getAllHolidays(2010)
The content of the holidays2010
variable will be the following array:
[
{ date: '2010-01-01', type: 1, name: 'Año Nuevo' },
{ date: '2010-05-01', type: 1, name: 'Día del Trabajo' },
{ date: '2010-07-20', type: 1, name: 'Grito de la Independencia' },
{ date: '2010-08-07', type: 1, name: 'Batalla de Boyacá' },
{ date: '2010-12-08', type: 1, name: 'Inmaculada Concepción' },
{ date: '2010-12-25', type: 1, name: 'Navidad' },
{ date: '2010-01-11', type: 2, name: 'Reyes Magos' },
{ date: '2010-03-22', type: 2, name: 'San José' },
{ date: '2010-07-05', type: 2, name: 'San Pedro y San Pablo' },
{ date: '2010-08-16', type: 2, name: 'Asunción de la Virgen' },
{ date: '2010-10-18', type: 2, name: 'Día de la Raza' },
{ date: '2010-11-01', type: 2, name: 'Todos los Santos' },
{ date: '2010-11-15', type: 2, name: 'Independencia de Cartagena' },
{ date: '2010-04-01', type: 3, name: 'Jueves Santo' },
{ date: '2010-04-02', type: 3, name: 'Viernes Santo' },
{ date: '2010-05-17', type: 3, name: 'Ascensión de Jesús' },
{ date: '2010-06-07', type: 3, name: 'Corpus Christi' },
{ date: '2010-06-14', type: 3, name: 'Sagrado Corazón de Jesús' },
],
Is the year is ommited, by default the function will return the holidays for the current year.
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
FAQs
Calculate Easter date for a given year
The npm package pascua receives a total of 326 weekly downloads. As such, pascua popularity was classified as not popular.
We found that pascua demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.