Tempo API
    Preparing search index...

    Interface BaseOptions

    Base configuration options for Tempo

    interface BaseOptions {
        calendar?: Evaluable<CalendarLike>;
        catch?: boolean;
        debug?: DebugLevel;
        discovery?: string | symbol | Discovery;
        error?: "catch" | "silent" | "log" | "throw";
        extends?: string | string[];
        geo?: GeoOptions;
        intl?: IntlOptions;
        locale?: Evaluable<string | readonly string[]>;
        localeInfo?: boolean;
        mode?: "auto" | "strict" | "defer";
        monthDay?: boolean | MonthDay;
        pivot?: number;
        planner?: PlannerOptions;
        pluginOptions?: Record<string, any>;
        plugins?: any;
        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[] | readonly string[]>;
            numbers?: Record<string, number>;
            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>;
        };
        silent?: boolean;
        sphere?: Evaluable<string | undefined>;
        store?: string;
        timestamp?: TimeStamp;
        timeStamp?: TimeStamp;
        timeZone?: Evaluable<TimeZoneLike>;
        value?: DateTime;
    }

    Hierarchy

    • BaseOptions
      • BaseOptions
    Index
    calendar?: Evaluable<CalendarLike>

    Temporal calendar

    catch?: boolean

    catch or throw Errors

    debug?: DebugLevel

    additional console.log for tracking

    discovery?: string | symbol | Discovery

    globalThis Discovery Symbol

    error?: "catch" | "silent" | "log" | "throw"

    convenience error handling policy preset

    extends?: string | string[]

    URLs or file paths to inherit configuration from

    geo?: GeoOptions

    Geolocation coordinates configuration for location-aware plugins

    intl?: IntlOptions

    internationalization configuration (relativeTime, etc.)

    locale?: Evaluable<string | readonly string[]>

    locale (e.g. en-AU)

    localeInfo?: boolean

    enable regional calendar boundaries (week start/end/mid) via Intl.LocaleInfo

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

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

    monthDay?: boolean | MonthDay

    regional date-parsing configuration

    pivot?: number

    pivot year for two-digit years

    planner?: PlannerOptions

    parse planner configuration (layoutOrder, etc.)

    pluginOptions?: Record<string, any>

    Plugin configuration defaults and dictionaries keyed by plugin name

    plugins?: any

    Plugins or terms to extend onto Tempo.

    To provide configuration options or defaults for plugins, use pluginOptions instead.

    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[] | readonly string[]>;
        numbers?: Record<string, number>;
        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>;
    }

    custom data augmentation registries

    Type Declaration

    • Optionalevents?:
          | 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>

      Event registry for special dates

    • Optionalformats?: Property<any>

      Format string templates

    • Optionalignores?: Ignore

      Noise words to ignore during parsing

    • Optionallayouts?:
          | Extend<{ readonly [key: symbol]: string }, symbol, string>
          | RegistryOption<Pattern>

      Layout registry for date/time patterns

    • Optionallocales?: Record<string, Record<string, string | Function>>

      Locale-specific configurations

    • Optionalmodifiers?: Record<string, string | string[] | readonly string[]>

      Temporal modifiers for relative dates

    • Optionalnumbers?: Record<string, number>

      Number name mappings

    • Optionalperiods?:
          | 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>

      Period registry for time-of-day aliases

    • Optionalsnippets?:
          | Extend<{ readonly [key: symbol]: RegExp }, symbol, RegExp>
          | RegistryOption<Pattern>

      Snippet registry for parsing shortcuts

    • Optionaltokens?: Record<string, TokenEvaluator>

      Token evaluators for custom parsing patterns

    silent?: boolean

    suppress console output during catch

    sphere?: Evaluable<string | undefined>

    hemisphere for term.qtr or term.szn

    store?: string

    localStorage key

    timestamp?: TimeStamp

    Precision to measure timestamps alias

    timeStamp?: TimeStamp

    Precision to measure timestamps (ms | us)

    timeZone?: Evaluable<TimeZoneLike>

    Temporal timeZone

    value?: DateTime

    supplied value to parse