npm.io
2.1.3 • Published 2 years ago

@types/next-biz-date

Licence
MIT
Version
2.1.3
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/next-biz-date

Summary

This package contains type definitions for next-biz-date (https://github.com/janunezc/next-biz-date#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/next-biz-date.

index.d.ts

import { Moment } from "moment";
/**
 * Returns the next applicable business day for a given candidate day.
 * If candidateDate is a business day then it returns the same provided candidateDate.
 * @param candidateDate Date to evaluate first for being bizdate (moment or string on yyyy-mm-dd format)
 * @param holidaysArray Array of holidays (strings on yyyy-mm-dd format)
 * @param direction FORWARD or BACKWARDS
 */
export function FindBizDate(candidateDate: Moment, holidaysArray: string[], direction?: Direction): Moment;

/***
 * Calculates next applicable business day out of counting bizdates starting from a provided base date up to a provided countTarget by skipping holidays and weekends.
 * @param baseDate date to start counting. Also conceptualized as day 0.
 * @param holidaysArray Array of holidays to consider.
 * @param [countTarget] Number of biz dates count.
 * @param [direction] FORWARD or BACKWARDS to count to the future or to the past respectively.
 */
export function FindNextBizDate(
    baseDate: string,
    holidaysArray: string[],
    countTarget?: number,
    direction?: Direction,
): Moment;

/**
 * count to the future or to the past respectively
 */
export type Direction = "FORWARD" | "BACKWARDS";

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: moment

Credits

These definitions were written by Piotr Błażejewicz.