ts-time/Era

Consumption

import Era, {BC, AD} from "ts-time/Era";

Default export#

Hierarchy#

  • interface Era

Description#

There are exactly 2 eras, with respective numeric values:
  1. BC
  2. AD

Fields#

id#

readonly id: string

Text identifier of the era.
value#

readonly value: number

Numeric value of the era.

BC#

BC: Era

Era representation of BC. Has numeric value of 0 and text identifier of "bc". Represents all dates when absolute year <= 0, but relative years of this era start at 1. Examples:
Absolute year Year of era
01
-12
-23

AD#

AD: Era

Era representation of AD. Has numeric value of 1 and text identifier of "ad". Represents all dates when absolute year > 0, and relative years of this era start as well at 1. Examples:
Absolute year Year of era
11
22
33