UNPKG

@kiwicredito/banking-holidays

Version:

A TypeScript package for detecting banking holidays in USA, Puerto Rico, and Dominican Republic

42 lines (41 loc) 1.91 kB
import { Country, Holiday, HolidayOptions, HolidayResponse, DateStatus } from './types'; /** * Check if a given date is a banking holiday and its working status */ export declare function getDateStatus(date: Date | string, country: Country): DateStatus; /** * Check if a given date is a banking holiday */ export declare function isHoliday(date: Date | string, country: Country): HolidayResponse; /** * Check if a given date is a working day */ export declare function isWorkingDay(date: Date | string, country: Country): boolean; /** * Get all holidays for a given period and country */ export declare function getHolidays(options?: HolidayOptions): Holiday[]; /** * Get the previous working day from a given date * @param date The date to start from (Date object, ISO string, or timestamp format) * @param country The country to check holidays for * @returns The previous working day */ export declare function getPreviousWorkingDay(date: Date | string, country: Country): Date; export declare function getNextWorkingDay(date: Date | string, country: Country): Date; /** * Get the working day that is N business days after the given date * @param date The date to start from (Date object or ISO string) * @param days Number of business days to add * @param country The country to check holidays for * @returns The working day N business days after the input date */ export declare function getNextWorkingNDays(date: Date | string, days: number, country: Country): Date; /** * Get the working day that is N business days before the given date * @param date The date to start from (Date object or ISO string) * @param days Number of business days to subtract * @param country The country to check holidays for * @returns The working day N business days before the input date */ export declare function getPreviousWorkingNDays(date: Date | string, days: number, country: Country): Date;