Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TimeUnit

A time unit is any particular time interval, used as a standard way of measuring or expressing duration.

Extending from its precursor, BaseTimeUnit, an object of this type contains both the mathematical and linguistic properties of the time unit it describes.


See TimeUnitDatabase for more information about time units.

Hierarchy

Index

Properties

Optional approximated

approximated: undefined | false | true

Determines whether this time unit is an approximation.

Optional customPlural

customPlural: string | NumericWriter

Defines a custom pluralized name for the time unit; it can be a string — used whenever the quantity of time is greater than one — or a function, able to retrieve different words according to a given quantity.

By default, words are pluralized by adding an "s" to the end of their readable name.

factor

factor: Decimal

Multiplicative factor (coefficient) of this time unit in relation to a nanosecond.

Optional pluralize

pluralize: undefined | false | true

Determines whether the time unit should be pluralized: by default, words are pluralized by adding an "s" to the end of their readable name, but this can be changed via customPlural.

If set to false, this will prevent the time unit from ever being pluralized (unless this configuration is overwritten).

Optional readableName

readableName: undefined | string

Name of the time unit presented in a human readable format.

For timecount's default language — English (US) — this is parsed from the name of the property that contains the time unit, taking advantage of its medial capitals to separate compound names (galacticYear parses as "galactic year").

In some cases, however, a custom readable name is required even in English (US) (planckTime, for example, would not be correctly capitalized as "Planck time").


If you wish to help timecount with a translation, plese consult Contributing: Translating.

Optional symbol

symbol: undefined | string

A symbol representing the time unit (e.g. "s" for seconds).

Generated using TypeDoc