Tempo API
    Preparing search index...

    Class Tempo

    Index

    Constructors

    • Instantiates a new Tempo object with configuration only.

      Parameters

      • Optionaloptions: Options

        Configuration options for this specific instance.

      Returns Tempo

    • Instantiates a new Tempo object with a value.

      Parameters

      • tempo: DateTime

        The date-time value to parse.

      • Optionaloptions: Options

        Configuration options for this specific instance.

      Returns Tempo

    Properties

    Interval: new (start: DateTime, end: DateTime) => Interval<Tempo> = ...

    Interval class for checking overlaps and bounds between Temporal points

    Accessors

    • get epoch(): { ms: number; ns: bigint; ss: number; us: number }

      units since epoch for this date-time instance

      Returns { ms: number; ns: bigint; ss: number; us: number }

      • Readonlyms: number

        milliseconds since epoch

      • Readonlyns: bigint

        nanoseconds since epoch

      • Readonlyss: number

        seconds since epoch

      • Readonlyus: number

        microseconds since epoch

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

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

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

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

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

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

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

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

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

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

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

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

    • get cache(): {
          clear(count?: number): void;
          delete(key: string): boolean;
          deletePrefix(prefix: string): number;
          entries(): MapIterator<[string, string]>;
          fromEntries(
              entries: Iterable<readonly [string, string]>,
          ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 4 more ...; readonly fromEntries: (entries: Iterable<...>) => ...; };
          get(key: string): string | undefined;
          has(key: string): boolean;
          set(
              key: string,
              value: string,
          ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 4 more ...; readonly fromEntries: (entries: Iterable<...>) => ...; };
          setStatic(
              key: string,
              value: string,
          ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 4 more ...; readonly fromEntries: (entries: Iterable<...>) => ...; };
      }

      high-performance in-memory cache facade for glossary and dynamic parse results

      Returns {
          clear(count?: number): void;
          delete(key: string): boolean;
          deletePrefix(prefix: string): number;
          entries(): MapIterator<[string, string]>;
          fromEntries(
              entries: Iterable<readonly [string, string]>,
          ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 4 more ...; readonly fromEntries: (entries: Iterable<...>) => ...; };
          get(key: string): string | undefined;
          has(key: string): boolean;
          set(
              key: string,
              value: string,
          ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 4 more ...; readonly fromEntries: (entries: Iterable<...>) => ...; };
          setStatic(
              key: string,
              value: string,
          ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 4 more ...; readonly fromEntries: (entries: Iterable<...>) => ...; };
      }

    • get CACHE(): EnumifyType<{ Off: false; On: true; Refresh: "refresh" }>

      cache operation modes

      Returns EnumifyType<{ Off: false; On: true; Refresh: "refresh" }>

    • get default(): Readonly<
          {
              calendar?: CalendarLike;
              catch?: boolean;
              debug?: DebugLevel;
              discovery?: string
              | symbol
              | Discovery;
              intl?: IntlOptions;
              license?: string;
              locale?: string | string[];
              mode?: "auto" | "strict" | "defer";
              monthDay?: boolean | MonthDay;
              pivot?: number;
              planner?: PlannerOptions;
              plugins?: TempoPlugin | TermPlugin | (TempoPlugin | TermPlugin)[];
              registry?: {
                  events?:
                      | Extend<
                          {
                              christmas: "25 Dec";
                              "christmas ?eve": "24 Dec";
                              fortnight: (this: AliasContext) => AliasContext;
                              "new.?years? ?eve": "31 Dec";
                              "new.?years?(?: ?day)?": "01 Jan";
                              now: (this: AliasContext) => AliasContext;
                              ny: "01 Jan";
                              nye: "31 Dec";
                              today: (this: AliasContext) => ZonedDateTime;
                              tomorrow: (this: AliasContext) => AliasContext;
                              xmas: "25 Dec";
                              "xmas ?eve": "24 Dec";
                              yesterday: (this: AliasContext) => AliasContext;
                          },
                          string,
                          string
                          | Function,
                      >
                      | RegistryOption<Logic>;
                  formats?: Property<any>;
                  ignores?: Ignore;
                  layouts?:
                      | Extend<{ readonly [key: symbol]: string }, symbol, string>
                      | RegistryOption<Pattern>;
                  locales?: Record<string, Record<string, string | Function>>;
                  modifiers?: Record<string, string | string[]>;
                  periods?:
                      | Extend<
                          {
                              "after[ -]?noon": "3:00pm";
                              evening: "18:00";
                              "half[ -]?hour": (this: AliasContext) => 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,
                      >
                      | RegistryOption<Logic>;
                  snippets?:
                      | Extend<{ readonly [key: symbol]: RegExp }, symbol, RegExp>
                      | RegistryOption<Pattern>;
                  tokens?: Record<string, TokenEvaluator>;
              };
              scope: "default";
              silent?: boolean;
              sphere?: string;
              store?: string;
              timeStamp?: TimeStamp;
              timeZone: TimeZoneLike;
              value?: DateTime;
          },
      >

      Tempo initial default settings

      Returns Readonly<
          {
              calendar?: CalendarLike;
              catch?: boolean;
              debug?: DebugLevel;
              discovery?: string
              | symbol
              | Discovery;
              intl?: IntlOptions;
              license?: string;
              locale?: string | string[];
              mode?: "auto" | "strict" | "defer";
              monthDay?: boolean | MonthDay;
              pivot?: number;
              planner?: PlannerOptions;
              plugins?: TempoPlugin | TermPlugin | (TempoPlugin | TermPlugin)[];
              registry?: {
                  events?:
                      | Extend<
                          {
                              christmas: "25 Dec";
                              "christmas ?eve": "24 Dec";
                              fortnight: (this: AliasContext) => AliasContext;
                              "new.?years? ?eve": "31 Dec";
                              "new.?years?(?: ?day)?": "01 Jan";
                              now: (this: AliasContext) => AliasContext;
                              ny: "01 Jan";
                              nye: "31 Dec";
                              today: (this: AliasContext) => ZonedDateTime;
                              tomorrow: (this: AliasContext) => AliasContext;
                              xmas: "25 Dec";
                              "xmas ?eve": "24 Dec";
                              yesterday: (this: AliasContext) => AliasContext;
                          },
                          string,
                          string
                          | Function,
                      >
                      | RegistryOption<Logic>;
                  formats?: Property<any>;
                  ignores?: Ignore;
                  layouts?:
                      | Extend<{ readonly [key: symbol]: string }, symbol, string>
                      | RegistryOption<Pattern>;
                  locales?: Record<string, Record<string, string | Function>>;
                  modifiers?: Record<string, string | string[]>;
                  periods?:
                      | Extend<
                          {
                              "after[ -]?noon": "3:00pm";
                              evening: "18:00";
                              "half[ -]?hour": (this: AliasContext) => 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,
                      >
                      | RegistryOption<Logic>;
                  snippets?:
                      | Extend<{ readonly [key: symbol]: RegExp }, symbol, RegExp>
                      | RegistryOption<Pattern>;
                  tokens?: Record<string, TokenEvaluator>;
              };
              scope: "default";
              silent?: boolean;
              sphere?: string;
              store?: string;
              timeStamp?: TimeStamp;
              timeZone: TimeZoneLike;
              value?: DateTime;
          },
      >

    • get epoch(): { ms: number; ns: bigint; ss: number; us: number }

      static units since Unix epoch

      Returns { ms: number; ns: bigint; ss: number; us: number }

      • Readonlyms: number

        milliseconds since epoch

      • Readonlyns: bigint

        nanoseconds since epoch

      • Readonlyss: number

        seconds since epoch

      • Readonlyus: number

        microseconds since epoch

    • get 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: "{ymd}T{hms}.{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: "{ymd}";
                  yearWeek: "{yw}{wy}";
              },
          >,
          string,
          string,
      >

      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: "{ymd}T{hms}.{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: "{ymd}";
                  yearWeek: "{yw}{wy}";
              },
          >,
          string,
          string,
      >

    • get formats(): | 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: "{ymd}T{hms}.{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: "{ymd}";
                  yearWeek: "{yw}{wy}";
              },
          >,
          string,
          string,
      >
      | EnumifyType<any>

      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: "{ymd}T{hms}.{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: "{ymd}";
                      yearWeek: "{yw}{wy}";
                  },
              >,
              string,
              string,
          >
          | EnumifyType<any>

      Use Tempo.registry.formats instead

    • get license(): {
          audience?: string;
          error?: string;
          expires?: string
          | number;
          issuedAt?: string | number;
          issuer?: string;
          jti?: string;
          role?: string;
          scopes: { [k: string]: any };
          status: string;
          subject?: string;
      }

      human-readable formatted license state

      Returns {
          audience?: string;
          error?: string;
          expires?: string | number;
          issuedAt?: string | number;
          issuer?: string;
          jti?: string;
          role?: string;
          scopes: { [k: string]: any };
          status: string;
          subject?: string;
      }

    • get LIMIT(): { get maxTempo(): bigint; get minTempo(): bigint }

      some useful Dates

      Returns { get maxTempo(): bigint; get minTempo(): bigint }

      • get maxTempo(): bigint

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

      • get minTempo(): bigint

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

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

      initialization strategies

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

    • get MONTH_DAY(): {
          layouts: readonly [
              readonly ["dayMonthYearShort", "monthDayYearShort"],
              readonly ["dayMonthYear", "monthDayYear"],
          ];
          locales: readonly ["en-US", "en-AS"];
          timezones: {
              "en-AS": readonly ["Pacific/Pago_Pago"];
              "en-US": readonly [
                  "America/Adak",
                  "America/Anchorage",
                  "America/Boise",
                  "America/Chicago",
                  "America/Denver",
                  "America/Detroit",
                  "America/Indiana/Indianapolis",
                  "America/Indiana/Knox",
                  "America/Indiana/Marengo",
                  "America/Indiana/Petersburg",
                  "America/Indiana/Tell_City",
                  "America/Indiana/Vevay",
                  "America/Indiana/Vincennes",
                  "America/Indiana/Winamac",
                  "America/Indianapolis",
                  "America/Juneau",
                  "America/Kentucky/Louisville",
                  "America/Kentucky/Monticello",
                  "America/Los_Angeles",
                  "America/Louisville",
                  "America/Menominee",
                  "America/Metlakatla",
                  "America/New_York",
                  "America/Nome",
                  "America/North_Dakota/Beulah",
                  "America/North_Dakota/Center",
                  "America/North_Dakota/New_Salem",
                  "America/Phoenix",
                  "America/Sitka",
                  "America/Yakutat",
                  "Pacific/Honolulu",
                  "US/Aleutian",
                  "US/Alaska",
                  "US/Arizona",
                  "US/Central",
                  "US/Eastern",
                  "US/Mountain",
                  "US/Pacific",
              ];
          };
      }

      regional date-parsing configuration

      Returns {
          layouts: readonly [
              readonly ["dayMonthYearShort", "monthDayYearShort"],
              readonly ["dayMonthYear", "monthDayYear"],
          ];
          locales: readonly ["en-US", "en-AS"];
          timezones: {
              "en-AS": readonly ["Pacific/Pago_Pago"];
              "en-US": readonly [
                  "America/Adak",
                  "America/Anchorage",
                  "America/Boise",
                  "America/Chicago",
                  "America/Denver",
                  "America/Detroit",
                  "America/Indiana/Indianapolis",
                  "America/Indiana/Knox",
                  "America/Indiana/Marengo",
                  "America/Indiana/Petersburg",
                  "America/Indiana/Tell_City",
                  "America/Indiana/Vevay",
                  "America/Indiana/Vincennes",
                  "America/Indiana/Winamac",
                  "America/Indianapolis",
                  "America/Juneau",
                  "America/Kentucky/Louisville",
                  "America/Kentucky/Monticello",
                  "America/Los_Angeles",
                  "America/Louisville",
                  "America/Menominee",
                  "America/Metlakatla",
                  "America/New_York",
                  "America/Nome",
                  "America/North_Dakota/Beulah",
                  "America/North_Dakota/Center",
                  "America/North_Dakota/New_Salem",
                  "America/Phoenix",
                  "America/Sitka",
                  "America/Yakutat",
                  "Pacific/Honolulu",
                  "US/Aleutian",
                  "US/Alaska",
                  "US/Arizona",
                  "US/Central",
                  "US/Eastern",
                  "US/Mountain",
                  "US/Pacific",
              ];
          };
      }

    • get 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,
      >

      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,
      >

    • get parse(): {
          anchor?: ZonedDateTime;
          event: {
              christmas: "25 Dec";
              "christmas ?eve": "24 Dec";
              fortnight: (this: AliasContext) => AliasContext;
              "new.?years? ?eve": "31 Dec";
              "new.?years?(?: ?day)?": "01 Jan";
              now: (this: AliasContext) => AliasContext;
              ny: "01 Jan";
              nye: "31 Dec";
              today: (this: AliasContext) => ZonedDateTime;
              tomorrow: (this: AliasContext) => AliasContext;
              xmas: "25 Dec";
              "xmas ?eve": "24 Dec";
              yesterday: (this: AliasContext) => AliasContext;
              readonly [key: string]: string | Function;
          };
          ignore: { readonly [key: string]: string };
          isAnchored?: boolean;
          layout: { readonly [key: symbol]: string };
          mode: "auto" | "strict" | "defer";
          monthDay: MonthDay;
          pattern: Registry;
          period: {
              "after[ -]?noon": "3:00pm";
              evening: "18:00";
              "half[ -]?hour": (this: AliasContext) => string;
              "mid[ -]?day": "12:00";
              "mid[ -]?morning": "10:00";
              "mid[ -]?night": "24:00";
              morning: "8:00";
              night: "20:00";
              noon: "12:00";
              readonly [key: string]: string | Function;
          };
          pivot: number;
          planner: { layoutOrder: (string | symbol)[]; preFilter: boolean };
          result: Match[];
          snippet: { readonly [key: symbol]: RegExp };
          token: Extend;
      }

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

      Returns {
          anchor?: ZonedDateTime;
          event: {
              christmas: "25 Dec";
              "christmas ?eve": "24 Dec";
              fortnight: (this: AliasContext) => AliasContext;
              "new.?years? ?eve": "31 Dec";
              "new.?years?(?: ?day)?": "01 Jan";
              now: (this: AliasContext) => AliasContext;
              ny: "01 Jan";
              nye: "31 Dec";
              today: (this: AliasContext) => ZonedDateTime;
              tomorrow: (this: AliasContext) => AliasContext;
              xmas: "25 Dec";
              "xmas ?eve": "24 Dec";
              yesterday: (this: AliasContext) => AliasContext;
              readonly [key: string]: string | Function;
          };
          ignore: { readonly [key: string]: string };
          isAnchored?: boolean;
          layout: { readonly [key: symbol]: string };
          mode: "auto" | "strict" | "defer";
          monthDay: MonthDay;
          pattern: Registry;
          period: {
              "after[ -]?noon": "3:00pm";
              evening: "18:00";
              "half[ -]?hour": (this: AliasContext) => string;
              "mid[ -]?day": "12:00";
              "mid[ -]?morning": "10:00";
              "mid[ -]?night": "24:00";
              morning: "8:00";
              night: "20:00";
              noon: "12:00";
              readonly [key: string]: string | Function;
          };
          pivot: number;
          planner: { layoutOrder: (string | symbol)[]; preFilter: boolean };
          result: Match[];
          snippet: { readonly [key: symbol]: RegExp };
          token: Extend;
      }

      • Optional Readonlyanchor?: ZonedDateTime

        anchor value used for this parse operation

      • Readonlyevent: {
            christmas: "25 Dec";
            "christmas ?eve": "24 Dec";
            fortnight: (this: AliasContext) => AliasContext;
            "new.?years? ?eve": "31 Dec";
            "new.?years?(?: ?day)?": "01 Jan";
            now: (this: AliasContext) => AliasContext;
            ny: "01 Jan";
            nye: "31 Dec";
            today: (this: AliasContext) => ZonedDateTime;
            tomorrow: (this: AliasContext) => AliasContext;
            xmas: "25 Dec";
            "xmas ?eve": "24 Dec";
            yesterday: (this: AliasContext) => AliasContext;
            readonly [key: string]: string | Function;
        }
      • Readonlyignore: { readonly [key: string]: string }
      • Optional ReadonlyisAnchored?: boolean

        was this a nested/anchored parse?

      • Readonlylayout: { readonly [key: symbol]: string }
      • Readonlymode: "auto" | "strict" | "defer"

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

      • ReadonlymonthDay: MonthDay
      • Readonlypattern: Registry

        Map of regex-patterns to match input-string

      • Readonlyperiod: {
            "after[ -]?noon": "3:00pm";
            evening: "18:00";
            "half[ -]?hour": (this: AliasContext) => string;
            "mid[ -]?day": "12:00";
            "mid[ -]?morning": "10:00";
            "mid[ -]?night": "24:00";
            morning: "8:00";
            night: "20:00";
            noon: "12:00";
            readonly [key: string]: string | Function;
        }
      • Readonlypivot: number

        pivot year for two-digit years

      • planner: { layoutOrder: (string | symbol)[]; preFilter: boolean }
      • Readonlyresult: Match[]

        parsing match result

      • Readonlysnippet: { readonly [key: symbol]: RegExp }
      • Readonlytoken: Extend

        Symbol registry

    • get terms(): SecureArray<PremiumPlugin> & Record<string, PremiumPlugin>

      static Tempo.terms (registry)

      Returns SecureArray<PremiumPlugin> & Record<string, PremiumPlugin>

    • get 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,
      >

      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,
      >

    • get versions(): Readonly<Record<string, string>>

      the active versions of Tempo and any registered plugins or modules

      Returns Readonly<Record<string, string>>

    Methods

    • iterate over instance formats

      Returns ArrayIterator<EntryOf<Record<string, string | undefined>>>

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

      Parameters

      • Optionalhint: "string" | "number" | "default"

      Returns string | number | bigint

    • apply a custom format.

      Parameters

      • Optionalfmt: any
      • Optionaloptions: any

      Returns string

    • applies a format to the instance.

      Parameters

      • options: FormatOptions

      Returns string

    • Applies a format to the instance. Format strings are validated at compile time — any unrecognised {token} will produce an IDE error showing the bad token name.

      Type Parameters

      • S extends string

      Parameters

      • fmt: string extends S ? S : string extends ValidateFormat<S> ? S : ValidateFormat<S>
      • Optionaloptions: any

      Returns string

      TempoFormatTokens to extend the token set.

    • applies a format to the instance (zero-argument — returns a pre-built format proxy).

      Returns string

    • time elapsed since another date-time

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns Duration

    • time elapsed since another date-time

      Parameters

      • unit: Unit
      • Optionalopts: Options

      Returns number

    • time elapsed since another date-time

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • unit: Unit

      Returns number

    • time elapsed since (with unit)

      Parameters

      • until: Until
      • Optionalopts: Options

      Returns string

    • time elapsed since another date-time (with unit)

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • until: Until

      Returns string

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

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns string

    • time elapsed since another date-time

      Parameters

      • OptionaloptsOrDate: any
      • OptionaloptsOrUntil: any

      Returns string

    • Custom JSON serialization for JSON.stringify.

      Returns {
          calendar: CalendarLike;
          catch: boolean;
          debug: DebugLevel;
          discovery: string | symbol | Discovery;
          intl: IntlOptions;
          license?: string;
          locale: string | string[];
          mode: "auto" | "strict" | "defer";
          plugins: TempoPlugin | TermPlugin | (TempoPlugin | TermPlugin)[];
          registry: {
              formats: EnumifyType;
              locales: Record<string, Record<string, string | Function>>;
              modifiers?: Record<string, string | string[]>;
              tokens?: Record<string, TokenEvaluator>;
          };
          scope: "global"
          | "local";
          silent: boolean;
          sphere: string | undefined;
          store: string;
          timeStamp: TimeStamp;
          timeZone: TimeZoneLike;
          value: string;
      }

      • calendar: CalendarLike

        Temporal calendar

      • catch: boolean

        catch or throw Errors

      • debug: DebugLevel

        additional console.log for tracking

      • discovery: string | symbol | Discovery

        globalThis Discovery Symbol

      • intl: IntlOptions

        internationalization configuration (relativeTime, etc.)

      • Optionallicense?: string

        license key for premium features

      • locale: string | string[]

        locale (e.g. en-AU)

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

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

      • plugins: TempoPlugin | TermPlugin | (TempoPlugin | TermPlugin)[]

        plugins to be automatically extended

      • registry: {
            formats: EnumifyType;
            locales: Record<string, Record<string, string | Function>>;
            modifiers?: Record<string, string | string[]>;
            tokens?: Record<string, TokenEvaluator>;
        }

        custom data augmentation registries

      • scope: "global" | "local"

        scope for configuration mutations

      • silent: boolean

        suppress console output during catch

      • sphere: string | undefined

        hemisphere for term.qtr or term.szn

      • store: string

        localStorage key

      • timeStamp: TimeStamp

        Precision to measure timestamps (ms | us)

      • timeZone: TimeZoneLike

        Temporal timeZone

      • value: string
    • time duration until another date-time

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns Duration

    • time duration until another date-time

      Parameters

      • unit: Unit
      • Optionalopts: Options

      Returns number

    • time duration until another date-time

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • unit: Unit

      Returns number

    • time duration until (returns Duration)

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns Duration

    • time duration until (with unit, returns number)

      Parameters

      • unit: Unit
      • Optionalopts: Options

      Returns number

    • time duration until another date-time (with unit)

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • unit: Unit

      Returns number

    • fallback: union of possible returns

      Parameters

      • OptionaloptsOrDate:
            | string
            | number
            | bigint
            | TempoBrand
            | ZonedDateTime
            | Instant
            | Options
            | PlainDate
            | PlainDateTime
            | ZonedDateTimeLikeObject
            | ISOString
            | Date
            | Tempo
            | PlainTime
            | Duration
            | Options & { unit?: Unit }
            | null
      • OptionaloptsOrUntil: Options | Until

      Returns number | Duration

    • Automatically discovers and loads configuration from tempo.config.* before initializing the engine.

      Parameters

      • Optionaloptions: { configFile?: string; cwd?: string }

      Returns Promise<typeof Tempo>

    • Compares two Tempo instances or date-time values. Returns -1 (earlier), 0 (equal), or 1 (later).

      Parameters

      • Optionaltempo1: Options | DateTime
      • Optionaltempo2: Options | DateTime

      Returns number

    • 🏭 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: Options = {}

      Returns typeof Tempo

    • Register a plugin or term extension.

      Parameters

      • plugin: TempoPlugin

        A plugin or term extension to register.

      • Optionaloptions: Options

        Optional configuration for the plugin.

      Returns typeof Tempo

    • Register an array of plugins or term extensions.

      Parameters

      • plugins: any[]

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

      • Optionaloptions: Options

        Optional configuration for the plugins.

      Returns typeof Tempo

    • Register multiple plugins or term extensions.

      Parameters

      • ...args: any[]

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

      Returns typeof Tempo

    • Wait for the background licensing and validation engine to finish settling. Resolves immediately if no license key or validation is pending.

      Returns Promise<string>

      The final, human-readable license status ('none', 'active', 'expired', etc.)

    • translates {layout} into an anchored, case-insensitive RegExp.

      Parameters

      • layout: string | RegExp
      • Optionalsnippet: Extend<{ readonly [key: symbol]: RegExp }, symbol, RegExp>

      Returns RegExp