• @flightlesslabs/time-utils
  • all symbols
default

Functions

f
createDateFactory(customDayjs?: DateFactoryDayjs): CreateDateFactoryReturn

Creates a date factory bound to a specific Dayjs instance.

f
timeout<T = void>(
milliseconds: number,
value?: T
): Promise<T>

Creates a promise that resolves after a specified delay.

Interfaces

I
CreateDateOptions
  • strict: boolean
  • throwOnInvalid: boolean
  • timezone: string
  • utc: boolean

Type Aliases

T
CreateDateFactoryReturn = { createDate: { (): ReturnType<DateFactoryDayjs>; (
date: CreateDateInput,
format?: CreateDateFormat,
options?: CreateDateOptions
): ReturnType<DateFactoryDayjs>; }
; dayjs: DateFactoryDayjs; }

Return type of createDateFactory.

  • createDate: { (): ReturnType<DateFactoryDayjs>; (
    date: CreateDateInput,
    format?: CreateDateFormat,
    options?: CreateDateOptions
    ): ReturnType<DateFactoryDayjs>; }

    Unified date creation function.

  • dayjs: DateFactoryDayjs

    Underlying Dayjs instance used by this factory.

T
CreateDateFormat = string | undefined
T
CreateDateInput = ConfigType
T
DateFactoryDayjs = defaultDayjs

Variables

v
createDate

Default preconfigured createDate function.