fluent.js
    Preparing search index...

    Class FluentDateTime

    A FluentType representing a date and time.

    A FluentDateTime instance stores a Date object, Temporal object, or a number as a numerical timestamp in milliseconds. It may also store an option bag of options which will be passed to Intl.DateTimeFormat when the FluentDateTime is formatted to a string.

    Hierarchy (View Summary)

    • FluentType<number | Date | TemporalObject>
      • FluentDateTime
    Index

    Constructors

    • Create an instance of FluentDateTime with options to the Intl.DateTimeFormat constructor.

      Parameters

      • value: number | Date | FluentType<number> | TemporalObject | FluentDateTime

        The number value of this FluentDateTime, in milliseconds.

      • opts: DateTimeFormatOptions = {}

        Options which will be passed to Intl.DateTimeFormat.

      Returns FluentDateTime

    Properties

    opts: DateTimeFormatOptions

    Options passed to Intl.DateTimeFormat.

    value: number | Date | TemporalObject

    The wrapped native value.

    Methods

    • Convert this FluentDateTime to a number. Note that this isn't always possible due to the nature of Temporal objects. In such cases, a TypeError will be thrown.

      Returns number

    • Unwrap the raw value stored by this FluentType.

      Returns number | Date | TemporalObject