Skip to main content

externalTimestamp

Represents a point in time.

Timestamp makes it easier for you to work with information related to time, like Serenity/JS domain events.

Learn more

Hierarchy

  • TinyType
    • Timestamp

Index

Constructors

externalconstructor

  • Parameters

    • externalvalue: Date = ...

    Returns Timestamp

Properties

publicexternalreadonlyvalue

value: Date = ...

Methods

staticexternalfromJSON

staticexternalfromTimestampInSeconds

  • fromTimestampInSeconds(value: number): Timestamp
  • Parameters

    • externalvalue: number

    Returns Timestamp

staticexternalfromTimestampInMilliseconds

  • fromTimestampInMilliseconds(value: number): Timestamp
  • Parameters

    • externalvalue: number

    Returns Timestamp

staticexternalnow

externaldiff

externalplus

externalless

externalisBefore

  • Parameters

    Returns boolean

externalisBeforeOrEqual

  • Parameters

    Returns boolean

externalisAfter

  • Parameters

    Returns boolean

externalisAfterOrEqual

  • Parameters

    Returns boolean

externaltoMilliseconds

  • toMilliseconds(): number
  • Returns number

externaltoSeconds

  • toSeconds(): number
  • Returns number

externaltoJSON

  • toJSON(): string
  • Returns string

externaltoISOString

  • toISOString(): string
  • Returns string

externaltoString

  • toString(): string
  • Returns string

external[custom]

  • [custom](): string
  • Returns string

externalequals

  • equals(another: TinyType): boolean
  • @desc

    Compares two tiny types by value

    @example
    class Id extends TinyTypeOf<string>() {}

    const id = new Id(`3cc0852d-fda7-4f61-874e-0cfadbd6182a`);

    id.equals(id) === true
    @example
    class FirstName extends TinyTypeOf<string>() {}
    class LastName extends TinyTypeOf<string>() {}
    class Age extends TinyTypeOf<number>() {}

    class Person extends TinyType {
    constructor(public readonly firstName: FirstName,
    public readonly lastName: LastName,
    public readonly age: Age,
    ) {
    super();
    }
    }

    const p1 = new Person(new FirstName('John'), new LastName('Smith'), new Age(42)),
    p2 = new Person(new FirstName('John'), new LastName('Smith'), new Age(42));

    p1.equals(p2) === true

    Parameters

    • externalanother: TinyType

    Returns boolean