npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

holidaysrd

v0.0.2

Published

holidayRD es una libreria que te permite validar si una fecha es feriado en la Republica Dominicana

Downloads

11

Readme

holidaysRD

Descripción

HolidaysRD es una biblioteca JavaScript que proporciona una colección de funciones para trabajar con días festivos en la República Dominicana.

Características

  • Recuperar una lista de todos los días festivos de un año determinado.
  • Consultar si una fecha concreta es festiva.
  • Obtener el próximo feriado a partir de una fecha determinada.
  • Obtener los feriados de un mes determinado.
  • Recupera una lista de los dias feriados de fines de semana largos
  • Calcular el número de días hábiles entre dos fechas, excluyendo festivos.

Instalación

Puede instalar HolidaysRD a través de npm:

npm i holidaysrd

Object holidayRD

Consta de propiedades como:

  • dayOfYear dia del año representa la fecha.
  • day dia de la semana
  • celebration Nombre de la festividad
  • date Fecha de la festividad
  • longWeekend Representa si esta festidad toca en fin de semana largo
type holidayRD = {
	dayOfYear: number,
	day: string,
	celebration: string,
	date: string,
	longWeekend: boolean
};

Funciones Disponibles

getHolidays(year: Date): holidayRD[]

Obtiene todos los días feriados para el año dado.

const holidays = getHolidays(new Date());
console.log(holidays);

getHolidaysOfMonth(date: Date): holidayRD[]

Devuelve todos los días feriados para el mes del año proporcionado.

const monthHolidays = getHolidaysOfMonth(new Date(2023, 0)); // Enero 2023
console.log(monthHolidays);

isHoliday(date: Date): boolean

Verifica si una fecha específica es un día feriado.

const isHolidayFlag = isHoliday(new Date(2023, 0, 1)); // 1 de enero de 2023
console.log(isHolidayFlag ? 'Es feriado' : 'No es feriado');

upcomingHolidays(date: Date): holidayRD[]

Devuelve el Lista de los proximos días feriados para la fecha proporcionado

const Holidays = upcomingHolidays(new Date(2023, 0, 1));
console.log(Holidays);

nextHoliday(date: Date): holidayRD[]

Devuelve el siguiente días feriados para la fecha proporcionado

const Holidays = nextHoliday(new Date(2023, 0, 1));
console.log(Holidays);

getLongWeekends(year: number): holidayRD[]

Lista todos los fines de semana largos para el año proporcionado.

const longWeekends = getLongWeekends(2023);
console.log(longWeekends);

getLongWeekendsOfMonth(date: Date): holidayRD[]

Lista de Fines de semana largo en el mes del año indicado.

const monthLongWeekends = getLongWeekendsOfMonth(new Date(2023, 0)); // Enero 2023
console.log(monthLongWeekends);

isLongWeekend(date: Date): boolean

Verifica si una fecha específica es un día feriado de fin de semana largo.

const isLongWeekend = isLongWeekend(new Date(2023, 0, 1)); // 1 de enero de 2023
console.log(isLongWeekend ? 'Es Fin de semana largo' : 'No es Fin de semana largo');

upcomingLongWeekends(date: Date): holidayRD[]

Obtiene los próximos fines de semana largos a partir de la fecha proporcionada.

const upcomingWeekends = upcomingLongWeekends(new Date());
console.log(upcomingWeekends);

nextLongWeekend(date: Date): holidayRD | undefined

Devuelve el próximo fin de semana largo después de la fecha dada.

const nextWeekend = nextLongWeekend(new Date());
console.log(nextWeekend);

countBusinessDays(startDate: Date, endDate: Date): number

Cuenta los días hábiles entre dos fechas.

const businessDays = countBusinessDays(new Date(2023, 0, 1), new Date(2023, 0, 31));
console.log(`Días hábiles en enero: ${businessDays}`);