Skip to content

@magmacomputing/tempo


Defined in: tempo.class.ts:65

Tempo

A powerful wrapper around Temporal.ZonedDateTime for flexible parsing and intuitive manipulation of date-time objects. Bridges the gap between raw string/number inputs and the strict requirements of the ECMAScript Temporal API.

Constructors

Constructor

new Tempo(options?): Tempo

Defined in: tempo.class.ts:1116

Instantiates a new Tempo object with configuration only.

Parameters

options?

Configuration options for this specific instance.

calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Tempo

Constructor

new Tempo(tempo, options?): Tempo

Defined in: tempo.class.ts:1123

Instantiates a new Tempo object with a value.

Parameters

tempo

DateTime

The date-time value to parse.

options?

Configuration options for this specific instance.

calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Tempo

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

Defined in: tempo.class.ts:1106

Returns

string


cal

Get Signature

get cal(): string

Defined in: tempo.class.ts:1331

Temporal Calendar ID (e.g., 'iso8601' | 'gregory')

Returns

string


config

Get Signature

get config(): Config

Defined in: tempo.class.ts:1368

current Tempo configuration

Returns

Config


day

Get Signature

get day(): number

Defined in: tempo.class.ts:1322

Day of the month (alias for dd)

Returns

number


dd

Get Signature

get dd(): number

Defined in: tempo.class.ts:1321

Day of the month (1-31)

Returns

number


dow

Get Signature

get dow(): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7

Defined in: tempo.class.ts:1337

ISO weekday number: Mon=1, Sun=7

Returns

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7


epoch

Get Signature

get epoch(): object

Defined in: tempo.class.ts:1400

units since epoch

Returns
ms

readonly ms: number

milliseconds since epoch

ns

readonly ns: bigint

nanoseconds since epoch

ss

readonly ss: number

seconds since epoch

us

readonly us: number

microseconds since epoch


ff

Get Signature

get ff(): number

Defined in: tempo.class.ts:1329

Fractional seconds (e.g., 0.123456789)

Returns

number


fmt

Get Signature

get fmt(): any

Defined in: tempo.class.ts:1399

Formatted results for all pre-defined format codes

Returns

any


hh

Get Signature

get hh(): hh

Defined in: tempo.class.ts:1323

Hour of the day (0-23)

Returns

hh


isValid

Get Signature

get isValid(): boolean | ZonedDateTime

Defined in: tempo.class.ts:1339

true if the underlying date-time is valid.

Returns

boolean | ZonedDateTime


mi

Get Signature

get mi(): mi

Defined in: tempo.class.ts:1324

Minutes of the hour (0-59)

Returns

mi


mm

Get Signature

get mm(): mm

Defined in: tempo.class.ts:1319

Month number: Jan=1, Dec=12

Returns

mm


mmm

Get Signature

get mmm(): "All" | "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"

Defined in: tempo.class.ts:1333

Short month name (e.g., 'Jan')

Returns

"All" | "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"


mon

Get Signature

get mon(): "May" | "Every" | "January" | "February" | "March" | "April" | "June" | "July" | "August" | "September" | "October" | "November" | "December"

Defined in: tempo.class.ts:1334

Full month name (e.g., 'January')

Returns

"May" | "Every" | "January" | "February" | "March" | "April" | "June" | "July" | "August" | "September" | "October" | "November" | "December"


ms

Get Signature

get ms(): ms

Defined in: tempo.class.ts:1326

Milliseconds of the second (0-999)

Returns

ms


nano

Get Signature

get nano(): bigint

Defined in: tempo.class.ts:1338

Nanoseconds since Unix epoch (BigInt)

Returns

bigint


ns

Get Signature

get ns(): ns

Defined in: tempo.class.ts:1328

Nanoseconds of the microsecond (0-999)

Returns

ns


parse

Get Signature

get parse(): Parse

Defined in: tempo.class.ts:1387

Instance-specific parse rules (merged with global)

Returns

Parse


ranges

Get Signature

get ranges(): Record<string, string>

Defined in: tempo.class.ts:1355

current range key for every registered term

Returns

Record<string, string>


ss

Get Signature

get ss(): ss

Defined in: tempo.class.ts:1325

Seconds of the minute (0-59)

Returns

ss


term

Get Signature

get term(): any

Defined in: tempo.class.ts:1398

Keyed results for all resolved terms

Returns

any


terms

Get Signature

get terms(): Record<string, string[]>

Defined in: tempo.class.ts:1342

list of registered terms and their available range keys

Returns

Record<string, string[]>


ts

Get Signature

get ts(): number | bigint

Defined in: tempo.class.ts:1332

Unix timestamp (defaults to milliseconds)

Returns

number | bigint


tz

Get Signature

get tz(): string

Defined in: tempo.class.ts:1330

IANA Time Zone ID (e.g., 'Australia/Sydney')

Returns

string


us

Get Signature

get us(): us

Defined in: tempo.class.ts:1327

Microseconds of the millisecond (0-999)

Returns

us


wkd

Get Signature

get wkd(): "Everyday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday"

Defined in: tempo.class.ts:1336

Full weekday name (e.g., 'Monday')

Returns

"Everyday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday"


ww

Get Signature

get ww(): ww

Defined in: tempo.class.ts:1320

ISO week number of the year

Returns

ww


www

Get Signature

get www(): "All" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"

Defined in: tempo.class.ts:1335

Short weekday name (e.g., 'Mon')

Returns

"All" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"


yw

Get Signature

get yw(): number | undefined

Defined in: tempo.class.ts:1318

4-digit ISO week-numbering year

Returns

number | undefined


yy

Get Signature

get yy(): number

Defined in: tempo.class.ts:1317

4-digit year (e.g., 2024)

Returns

number


config

Get Signature

get static config(): any

Defined in: tempo.class.ts:910

global Tempo configuration

Returns

any


default

Get Signature

get static default(): Readonly<{ calendar?: CalendarLike; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>; formats?: Property<any>; ignore?: Ignore; layout?: Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle; scope: "default"; silent?: boolean; snippet?: Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>; sphere?: string; store?: string; timeStamp?: TimeStamp; timeZone: TimeZoneLike; value?: DateTime; }>

Defined in: tempo.class.ts:974

Tempo initial default settings

Returns

Readonly<{ calendar?: CalendarLike; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>; formats?: Property<any>; ignore?: Ignore; layout?: Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle; scope: "default"; silent?: boolean; snippet?: Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>; sphere?: string; store?: string; timeStamp?: TimeStamp; timeZone: TimeZoneLike; value?: DateTime; }>


discovery

Get Signature

get static discovery(): any

Defined in: tempo.class.ts:927

global discovery configuration

Returns

any


FORMAT

Get Signature

get static FORMAT(): Extend<EnumifyType<{ date: "{yyyy}-{mm}-{dd}"; dayDate: "{dd}-{mmm}-{yyyy}"; dayMonth: "{dd}-{mmm}"; dayTime: "{dd}-{mmm}-{yyyy} {hh}:{mi}:{ss}"; display: "{www}, {dd} {mmm} {yyyy}"; logStamp: "{yyyy}{mm}{dd}T{hhmiss}.{ff}"; sortTime: "{yyyy}-{mm}-{dd} {hh}:{mi}:{ss}"; time: "{hh}:{mi}:{ss}"; weekDate: "{www}, {yyyy}-{mmm}-{dd}"; weekStamp: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}.{ff}"; weekTime: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}"; yearMonth: "{yyyy}{mm}"; yearMonthDay: "{yyyy}{mm}{dd}"; yearWeek: "{yw}{ww}"; }>, string, string | number>

Defined in: tempo.class.ts:77

Pre-configured format {name -> string} pairs

Returns

Extend<EnumifyType<{ date: "{yyyy}-{mm}-{dd}"; dayDate: "{dd}-{mmm}-{yyyy}"; dayMonth: "{dd}-{mmm}"; dayTime: "{dd}-{mmm}-{yyyy} {hh}:{mi}:{ss}"; display: "{www}, {dd} {mmm} {yyyy}"; logStamp: "{yyyy}{mm}{dd}T{hhmiss}.{ff}"; sortTime: "{yyyy}-{mm}-{dd} {hh}:{mi}:{ss}"; time: "{hh}:{mi}:{ss}"; weekDate: "{www}, {yyyy}-{mmm}-{dd}"; weekStamp: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}.{ff}"; weekTime: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}"; yearMonth: "{yyyy}{mm}"; yearMonthDay: "{yyyy}{mm}{dd}"; yearWeek: "{yw}{ww}"; }>, string, string | number>


formats

Get Signature

get static formats(): any

Defined in: tempo.class.ts:963

static Tempo.formats (registry)

Returns

any


ignores

Get Signature

get static ignores(): Secure<Ignore>

Defined in: tempo.class.ts:1006

static Tempo.ignores (registry)

Returns

Secure<Ignore>


instant

Get Signature

get static instant(): Instant

Defined in: tempo.class.ts:946

get the current system Instant

Returns

Instant


LIMIT

Get Signature

get static LIMIT(): object

Defined in: tempo.class.ts:81

some useful Dates

Returns
maxTempo
Get Signature

get maxTempo(): bigint

Tempo(31-Dec-9999.23:59:59).ns

Returns

bigint

minTempo
Get Signature

get minTempo(): bigint

Tempo(01-Jan-1000.00:00:00).ns

Returns

bigint


MODE

Get Signature

get static MODE(): EnumifyType<{ Auto: "auto"; Defer: "defer"; Strict: "strict"; }>

Defined in: tempo.class.ts:80

initialization strategies

Returns

EnumifyType<{ Auto: "auto"; Defer: "defer"; Strict: "strict"; }>


NUMBER

Get Signature

get static NUMBER(): Extend<EnumifyType<{ eight: 8; five: 5; four: 4; nine: 9; one: 1; seven: 7; six: 6; ten: 10; three: 3; two: 2; zero: 0; }>, string, number>

Defined in: tempo.class.ts:78

Number names (0-10)

Returns

Extend<EnumifyType<{ eight: 8; five: 5; four: 4; nine: 9; one: 1; seven: 7; six: 6; ten: 10; three: 3; two: 2; zero: 0; }>, string, number>


options

Get Signature

get static options(): any

Defined in: tempo.class.ts:933

Returns

any


parse

Get Signature

get static parse(): any

Defined in: tempo.class.ts:981

configuration governing the static 'rules' used when parsing t.DateTime argument

Returns

any


properties

Get Signature

get static properties(): SecureArray<string>

Defined in: tempo.class.ts:968

static Tempo properties getter

Returns

SecureArray<string>


terms

Get Signature

get static terms(): SecureArray<Omit<TermPlugin, "define" | "resolve">> & Record<string, Omit<TermPlugin, "define" | "resolve">>

Defined in: tempo.class.ts:949

static Tempo.terms (registry)

Returns

SecureArray<Omit<TermPlugin, "define" | "resolve">> & Record<string, Omit<TermPlugin, "define" | "resolve">>


TIMEZONE

Get Signature

get static TIMEZONE(): Extend<{ acst: "Australia/Adelaide"; aest: "Australia/Sydney"; awst: "Australia/Perth"; cet: "Europe/Paris"; cst: "America/Chicago"; eet: "Europe/Helsinki"; est: "America/New_York"; gmt: "Europe/London"; ist: "Asia/Kolkata"; jst: "Asia/Tokyo"; mst: "America/Denver"; npt: "Asia/Kathmandu"; nzt: "Pacific/Auckland"; pst: "America/Los_Angeles"; utc: "UTC"; }, string, string>

Defined in: tempo.class.ts:79

TimeZone aliases

Returns

Extend<{ acst: "Australia/Adelaide"; aest: "Australia/Sydney"; awst: "Australia/Perth"; cet: "Europe/Paris"; cst: "America/Chicago"; eet: "Europe/Helsinki"; est: "America/New_York"; gmt: "Europe/London"; ist: "Asia/Kolkata"; jst: "Asia/Tokyo"; mst: "America/Denver"; npt: "Asia/Kathmandu"; nzt: "Pacific/Auckland"; pst: "America/Los_Angeles"; utc: "UTC"; }, string, string>

Methods

[iterator]()

[iterator](): ArrayIterator<EntryOf<any>>

Defined in: tempo.class.ts:1102

iterate over instance formats

Returns

ArrayIterator<EntryOf<any>>


[toPrimitive]()

[toPrimitive](hint?): string | number | bigint

Defined in: tempo.class.ts:1093

allow for auto-convert of Tempo to BigInt, Number or String

Parameters

hint?

"string" | "number" | "default"

Returns

string | number | bigint


add()

add(tempo?, options?): Tempo

Defined in: tempo.class.ts:1422

returns a new Tempo with specific duration added.

Parameters

tempo?

MutateAdd

options?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Tempo


clone()

clone(): Tempo

Defined in: tempo.class.ts:1424

returns a clone of the current Tempo instance.

Returns

Tempo


format()

Call Signature

format<K>(fmt): any

Defined in: tempo.class.ts:1417

apply a custom format.

Type Parameters
K

K extends Format

Parameters
fmt

K

Returns

any

Call Signature

format(fmt): any

Defined in: discrete/discrete.format.ts:13

applies a format to the instance.

Parameters
fmt

any

Returns

any


set()

set(tempo?, options?): Tempo

Defined in: tempo.class.ts:1423

returns a new Tempo with specific offsets.

Parameters

tempo?

MutateSet

options?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Tempo


since()

Call Signature

since(arg0?, arg1?): any

Defined in: tempo.class.ts:1420

time elapsed since another date-time

Parameters
arg0?

any

arg1?

any

Returns

any

Call Signature

since(until, opts?): string

Defined in: module/module.duration.ts:24

time elapsed since (with unit)

Parameters
until

Until

opts?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

string

Call Signature

since(dateTimeOrOpts, until): string

Defined in: module/module.duration.ts:25

time elapsed since another date-time (with unit)

Parameters
dateTimeOrOpts

DateTime | {[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

DateTime


Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse

until

Until

Returns

string

Call Signature

since(dateTimeOrOpts?, opts?): string

Defined in: module/module.duration.ts:26

time elapsed since another date-time (w'out unit)

Parameters
dateTimeOrOpts?

DateTime | {[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

DateTime


Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse

opts?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

string

Call Signature

since(optsOrDate?, optsOrUntil?): string

Defined in: module/module.duration.ts:27

time elapsed since another date-time

Parameters
optsOrDate?

any

optsOrUntil?

any

Returns

string


toDate()

toDate(): Date

Defined in: tempo.class.ts:1433

the date-time as a standard Date object.

Returns

Date


toDateTime()

toDateTime(): ZonedDateTime

Defined in: tempo.class.ts:1426

returns the underlying Temporal.ZonedDateTime

Returns

ZonedDateTime


toInstant()

toInstant(): Instant

Defined in: tempo.class.ts:1430

returns the underlying Temporal.Instant

Returns

Instant


toJSON()

toJSON(): object

Defined in: tempo.class.ts:1442

Custom JSON serialization for JSON.stringify.

Returns

calendar

calendar: CalendarLike

Temporal calendar

catch

catch: boolean | undefined

catch or throw Errors

debug

debug: number | boolean | undefined

additional console.log for tracking

discovery

discovery: string | symbol

globalThis Discovery Symbol

formats

formats: EnumifyType

pre-configured format strings

locale

locale: string

locale (e.g. en-AU)

mode

mode: "auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

plugins

plugins: Plugin | Plugin[]

plugins to be automatically extended

rtfFormat

rtfFormat: RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle

rtfStyle: RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

scope

scope: "global" | "local"

configuration (global | local)

silent

silent: boolean | undefined

suppress console output during catch

sphere

sphere: string | undefined

hemisphere for term.qtr or term.szn

store

store: string

localStorage key

timeStamp

timeStamp: TimeStamp

Precision to measure timestamps (ms | us)

timeZone

timeZone: TimeZoneLike

Temporal timeZone

value

value: string


toNow()

toNow(): ZonedDateTime

Defined in: tempo.class.ts:1432

the current system time localized to this instance.

Returns

ZonedDateTime


toPlainDate()

toPlainDate(): PlainDate

Defined in: tempo.class.ts:1427

returns a Temporal.PlainDate representation

Returns

PlainDate


toPlainDateTime()

toPlainDateTime(): PlainDateTime

Defined in: tempo.class.ts:1429

returns a Temporal.PlainDateTime representation

Returns

PlainDateTime


toPlainTime()

toPlainTime(): PlainTime

Defined in: tempo.class.ts:1428

returns a Temporal.PlainTime representation

Returns

PlainTime


toString()

toString(): string

Defined in: tempo.class.ts:1435

ISO8601 string representation of the date-time.

Returns

string


until()

Call Signature

until(arg0?, arg1?): any

Defined in: tempo.class.ts:1419

time duration until another date-time

Parameters
arg0?

any

arg1?

any

Returns

any

Call Signature

until(dateTimeOrOpts?, opts?): Duration

Defined in: module/module.duration.ts:19

time duration until (returns Duration)

Parameters
dateTimeOrOpts?

DateTime | {[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

DateTime


Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse

opts?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Duration

Call Signature

until(unit, opts?): number

Defined in: module/module.duration.ts:20

time duration until (with unit, returns number)

Parameters
unit

Unit

opts?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

number

Call Signature

until(dateTimeOrOpts, unit): number

Defined in: module/module.duration.ts:21

time duration until another date-time (with unit)

Parameters
dateTimeOrOpts

DateTime | {[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

DateTime


Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse

unit

Unit

Returns

number

Call Signature

until(optsOrDate?, optsOrUntil?): number | Duration

Defined in: module/module.duration.ts:22

fallback: union of possible returns

Parameters
optsOrDate?

string | number | bigint | TempoBrand | ZonedDateTime | Instant | Tempo | PlainDate | PlainDateTime | ZonedDateTimeLikeObject | Date | PlainTime | Duration | {[key: string]: any; calendar?: CalendarLike; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>; formats?: Property<any>; ignore?: Ignore; layout?: Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle; silent?: boolean; snippet?: Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>; sphere?: string; store?: string; timeStamp?: TimeStamp; timeZone?: TimeZoneLike; value?: DateTime; } | object & object | null

string


number


bigint


TempoBrand


ZonedDateTime


Instant


Tempo


PlainDate


PlainDateTime


ZonedDateTimeLikeObject


Date


PlainTime


Duration


Type Literal

{[key: string]: any; calendar?: CalendarLike; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>; formats?: Property<any>; ignore?: Ignore; layout?: Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle; silent?: boolean; snippet?: Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>; sphere?: string; store?: string; timeStamp?: TimeStamp; timeZone?: TimeZoneLike; value?: DateTime; }

calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse


object & object


null

optsOrUntil?

Until | {[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

Until


Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

number | Duration


compare()

static compare(tempo1?, tempo2?): number

Defined in: tempo.class.ts:903

Compares two Tempo instances or date-time values.

Parameters

tempo1?

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; } | DateTime

Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse


DateTime

tempo2?

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; } | DateTime

Type Literal

{[key: string]: any; calendar?: CalendarLike | undefined; catch?: boolean; debug?: number | boolean; discovery?: string | symbol; event?: Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...; formats?: Property<any>; ignore?: Ignore | undefined; layout?: Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined; layoutOrder?: string[]; locale?: string; mdyLayouts?: Pair[]; mdyLocales?: string | string[]; mode?: "auto" | "strict" | "defer"; period?: Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...; pivot?: number; plugins?: Plugin | Plugin[]; rtfFormat?: RelativeTimeFormat; rtfStyle?: RelativeTimeFormatStyle | undefined; silent?: boolean; snippet?: Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined; sphere?: string; store?: string; timeStamp?: TimeStamp | undefined; timeZone?: TimeZoneLike | undefined; value?: DateTime; }

calendar?

CalendarLike | undefined

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ readonly 'new.?years? ?eve': "31 Dec"; readonly nye: "31 Dec"; readonly 'new.?years?( ?day)?': "01 Jan"; readonly ny: "01 Jan"; readonly 'christmas ?eve': "24 Dec"; readonly christmas: "25 Dec"; ... 6 more ...; readonly fortnight: (this: Tempo) => Tempo; }, string, string | Function> | PatternOption<...> | ...

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore | undefined

noise words to ignore during parsing.

layout?

Extend<{ readonly [x: symbol]: string; }, symbol, string> | PatternOption<Pattern> | undefined

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ readonly 'mid[ -]?night': "24:00"; readonly morning: "8:00"; readonly 'mid[ -]?morning': "10:00"; readonly 'mid[ -]?day': "12:00"; readonly noon: "12:00"; readonly 'after[ -]?noon': "3:00pm"; readonly evening: "18:00"; readonly night: "20:00"; readonly 'half[ -]?hour': (this: Tempo) => string; }, string, st...

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle | undefined

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{ readonly [x: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern> | undefined

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp | undefined

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike | undefined

Temporal timeZone

value?

DateTime

supplied value to parse


DateTime

Returns

number


create()

static create(options?): typeof Tempo

Defined in: tempo.class.ts:756

🏭 Sandbox Factory Mode Create a fresh, isolated Tempo subclass with its own configuration and registries. Returns a new class that inherits from the caller, but maintains independent state.

Parameters

options?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

typeof Tempo


extend()

Call Signature

static extend(plugin, options?): typeof Tempo

Defined in: tempo.class.ts:626

Register a plugin or term extension.

Parameters
plugin

Plugin

A plugin or term extension to register.

options?

Optional configuration for the plugin.

calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

typeof Tempo

Call Signature

static extend(plugins, options?): typeof Tempo

Defined in: tempo.class.ts:633

Register an array of plugins or term extensions.

Parameters
plugins

any[]

An array of plugins, terms, or extensions to register.

options?

Optional configuration for the plugins.

calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

typeof Tempo

Call Signature

static extend(...args): typeof Tempo

Defined in: tempo.class.ts:639

Register multiple plugins or term extensions.

Parameters
args

...any[]

A plugin, term, or list of extensions to register.

Returns

typeof Tempo


from()

Call Signature

static from(options?): Tempo

Defined in: tempo.class.ts:940

Creates a new Tempo instance.

Parameters
options?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Tempo

Call Signature

static from(tempo, options?): Tempo

Defined in: tempo.class.ts:941

Creates a new Tempo instance.

Parameters
tempo

DateTime

options?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

Tempo


init()

static init(options?): typeof Tempo

Defined in: tempo.class.ts:783

Reset Tempo to its default, built-in registration state

Parameters

options?
calendar?

CalendarLike

Temporal calendar

catch?

boolean

catch or throw Errors

debug?

number | boolean

additional console.log for tracking

discovery?

string | symbol

globalThis Discovery Symbol

event?

Extend<{ christmas: "25 Dec"; christmas ?eve: "24 Dec"; fortnight: (this) => Tempo; new.?years? ?eve: "31 Dec"; new.?years?( ?day)?: "01 Jan"; now: (this) => ZonedDateTime; ny: "01 Jan"; nye: "31 Dec"; today: (this) => ZonedDateTime; tomorrow: (this) => Tempo; xmas: "25 Dec"; xmas ?eve: "24 Dec"; yesterday: (this) => Tempo; }, string, string | Function> | PatternOption<Logic>

custom date aliases (events).

formats?

Property<any>

custom format strings to merge in the FORMAT enum

ignore?

Ignore

noise words to ignore during parsing.

layout?

Extend<{[key: symbol]: string; }, symbol, string> | PatternOption<Pattern>

patterns to help parse value

layoutOrder?

string[]

preferred parse-order of layouts

locale?

string

locale (e.g. en-AU)

mdyLayouts?

Pair[]

swap parse-order of layouts

mdyLocales?

string | string[]

locale-names that prefer 'mm-dd-yy' date order

mode?

"auto" | "strict" | "defer"

initialization strategy ('auto'|'strict'|'defer')

period?

Extend<{ after[ -]?noon: "3:00pm"; evening: "18:00"; half[ -]?hour: (this) => string; mid[ -]?day: "12:00"; mid[ -]?morning: "10:00"; mid[ -]?night: "24:00"; morning: "8:00"; night: "20:00"; noon: "12:00"; }, string, string | Function> | PatternOption<Logic>

custom time aliases (periods).

pivot?

number

pivot year for two-digit years

plugins?

Plugin | Plugin[]

plugins to be automatically extended

rtfFormat?

RelativeTimeFormat

Pre-configured relative time formatter

rtfStyle?

RelativeTimeFormatStyle

Default style for relative time ('long' | 'short' | 'narrow')

silent?

boolean

suppress console output during catch

snippet?

Extend<{[key: symbol]: RegExp; }, symbol, RegExp> | PatternOption<Pattern>

date-time snippets to help compose a Layout

sphere?

string

hemisphere for term.qtr or term.szn

store?

string

localStorage key

timeStamp?

TimeStamp

Precision to measure timestamps (ms | us)

timeZone?

TimeZoneLike

Temporal timeZone

value?

DateTime

supplied value to parse

Returns

typeof Tempo


isTempo()

static isTempo(instance?): instance is Tempo

Defined in: tempo.class.ts:1017

check if a supplied variable is a valid Tempo instance

Parameters

instance?

any

Returns

instance is Tempo


now()

static now(): bigint

Defined in: tempo.class.ts:944

Returns

bigint

Released under the MIT License.