Options
All
  • Public
  • Public/Protected
  • All
Menu

A class for detecting, parsing, and building identifiers to and from days.

An identifier is a simple value which represents a span of time. It may represent an entire year, a quarter (3 months) of a year, a week of a year, a month in a year, a specific day of a month of a year, or a specific hour, minute, day, and month of a year.

For example:

  • 2018: The year 2018
  • 201801: January 2018
  • 2014023: The 23rd week of 2014
  • 20170311: March 11th, 2017
  • 201406151651: June 15th 2016 at 4:51 pm
  • '0525': Year 525 of the first age, Elrond and Elros are born

Hierarchy

  • Identifier

Index

Properties

Static Day

Day: Identifier = null

The identifier type for a specific day.

Static Month

Month: Identifier = null

The identifier type for a specific month of a year.

Static Quarter

Quarter: Identifier = null

The identifier type for a specific quarter of a year.

Static Time

Time: Identifier = null

The identifier type for an hour of time on a specific day.

Static Week

Week: Identifier = null

The identifier type for a specific week of a year.

Static Year

Year: Identifier = null

The identifier type for a specific year.

Methods

Protected compute

  • Computes the identifier given values taken from a Day.

    Parameters

    • Rest ...values: number[]

      The values to compute.

    Returns IdentifierInput

    The computed identifier.

Protected decompute

  • Decomputes the given identifier and returns values which describe a span of time.

    Parameters

    Returns number[]

    The original values which computed the identifier.

Abstract describe

  • Describes the given identifier as a human friendly string.

    Parameters

    • id: IdentifierInput

      The identifier to describe.

    • short: boolean

      If the description should use shorter language or longer.

    Returns string

    The human friendly string that describes the identifier.

Abstract get

  • Returns the identifier of this type for the given day,

    Parameters

    • day: Day

      The day to get the identifier of.

    Returns IdentifierInput

    The identifier for the day of this type.

Protected Abstract getLength

  • getLength(): number
  • The length of the identifier of this type in digits.

    Returns number

Protected Abstract getScales

  • getScales(): number[]
  • The scales for all the different values stored in an identifier.

    Returns number[]

is

  • Determines whether the given identifier is this type.

    Parameters

    Returns boolean

    true if the identifier is this type, otherwise false.

Abstract matches

  • Determines if the day matches the given identifier.

    Parameters

    Returns boolean

    true if the day exists in the time span represented by the identifier, otherwise false.

Abstract object

Abstract span

  • Returns the span of time the identifier represents.

    Parameters

    • id: IdentifierInput

      The identifier to convert to a span.

    • endInclusive: boolean

      When true the end of the span will be the very last millisecond that represents the timespan, otherwise false the end will be the start of the very next span.

    Returns DaySpan

Abstract start

  • Returns the start of the time span the identifier represents.

    Parameters

    Returns Day

    The start of the time span the identifier represents.

Static contains

  • Determines whether the given time span outer contains the time span inner.

    Parameters

    • outer: IdentifierInput

      The potentially larger time span inner must be contained in.

    • inner: IdentifierInput

      The time span to test is contained inside outer.

    Returns boolean

    true if inner is equal to or contained in outer, otherwise false.

Static find

  • Finds which identifier type matches the given identifier, if any.

    Parameters

    Returns Identifier

    The found identifier type, otherwise null if none exists.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc