@types/moment-business-time
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Installation

npm install --save @types/moment-business-time

Summary

This package contains type definitions for moment-business-time (https://github.com/lennym/moment-business-time).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/moment-business-time.

index.d.ts

import * as moment from "moment";

declare module "moment" {
    interface Moment {
        nextWorkingDay: () => Moment;
        nextWorkingTime: () => Moment;

        /**
         * Returns a new object with moment and transition properties representing
         * the next moment when the business will transition between 'open' and 'closed' states.
         */
        nextTransitionTime: () => TransitionTime;

        /**
         * Returns a new object with moment and transition properties representing
         * the most recent moment when the business transitioned between 'open' and 'closed' states.
         */
        lastTransitionTime: () => TransitionTime;

        lastWorkingDay: () => Moment;
        lastWorkingTime: () => Moment;

        addWorkingTime: (...args: Array<number | unitOfTime.Base>) => Moment;
        subtractWorkingTime: (...args: Array<number | unitOfTime.Base>) => Moment;

        workingDiff: (moment: Moment, unit: unitOfTime.Base, fractions?: boolean) => number;

        isWorkingDay: () => boolean;
        isWorkingTime: () => boolean;
    }

    interface WorkingHoursMap {
        0: string[] | null;
        1: string[] | null;
        2: string[] | null;
        3: string[] | null;
        4: string[] | null;
        5: string[] | null;
        6: string[] | null;
    }

    interface LocaleSpecification {
        workinghours?: WorkingHoursMap | undefined;
        holidays?: string[] | undefined;
    }

    interface TransitionTime {
        moment: Moment;
        transition: "open" | "close";
    }
}

Additional Details

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

Credits

These definitions were written by Tomasz Nguyen, and Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/moment-business-time

Weekly Downloads

1,020

Version

1.1.4

License

MIT

Unpacked Size

6.06 kB

Total Files

5

Last publish

Collaborators

  • types