Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Chronometric

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Chronometric(duration?: number | (), conversionRatios?: ConversionRatioConfig): Chronometric
  • Parameters

    • Default value duration: number | () = {ms: 0,s: 0,m: 0,h: 0,d: 0,w: 0,mo: 0,y: 0}
    • Default value conversionRatios: ConversionRatioConfig = Chronometric.defaultConversionRatios

    Returns Chronometric

Properties

Static defaultConversionRatios

defaultConversionRatios: ConversionRatioConfig = DEFAULT_CONVERSION_RATIOS

Default conversion ratios for instances of Chronometric

Methods

toString

  • toString(): string

Static fromString

  • fromString(str: string, conversionRatios?: ): Chronometric
  • Parses string in "1d 1w 1mo" format and creates Chronometric instance

    Parameters

    • str: string

      String to parse duration from

    • Default value conversionRatios: = Chronometric.defaultConversionRatios

      Custom conversion ratios

      • [key: string]: number

    Returns Chronometric

Generated using TypeDoc