Options
All
  • Public
  • Public/Protected
  • All
Menu

Local date object

  • Represents date in year without timezone.

Hierarchy

  • LocalDate

Index

Constructors

  • 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

date: number
month: number
year: number

Methods

  • 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

  • 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

  • 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