Options
All
  • Public
  • Public/Protected
  • All
Menu

Local date object

  • Represents date in year without timezone.

Hierarchy

  • LocalDate

Index

Constructors

Properties

Methods

Constructors

constructor

  • new LocalDate(year: number, month: number, date: number): LocalDate
  • throws

    RangeError if value of any of the arguments are invalid, or the date formed by them is invalid (e.g 02/29/2021)

    throws

    TypeError if any of the arguments are of wrong type

    Parameters

    • year: number

      Must be between -999999999-999999999

    • month: number

      Must be between 1-12

    • date: number

      Must be between 1-31 depending on year and month

    Returns LocalDate

Properties

Readonly date

date: number

Readonly month

month: number

Readonly year

year: number

Methods

toString

  • toString(): string
  • Returns the string representation of this local date.

    Returns string

    A string in the form yyyy:mm:dd. Values are zero padded from left

Static fromDate

  • fromDate(date: Date): LocalDate
  • Constructs a new instance from Date.

    throws

    TypeError if the passed param is not a Date

    throws

    RangeError if an invalid Date is passed

    Parameters

    • date: Date

      must be a valid Date. date.getTime() should be not NaN

    Returns LocalDate

Static fromString

  • fromString(dateString: string): LocalDate
  • Constructs a LocalDate object from string.

    throws

    TypeError if a string is not passed

    throws

    RangeError if the string format is wrong

    Parameters

    • dateString: string

      String in the form of yyyy-mm-dd

    Returns LocalDate

Generated using TypeDoc