Local date object

  • Represents date in year without timezone.

Hierarchy

  • LocalDate

Constructors

Properties

Methods

Constructors

  • 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

Must be between 1-31 depending on year and month

month: number

Must be between 1-12

year: number

Must be between -999999999-999999999

Methods

  • Returns the string representation of this local date.

    Returns

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

    Returns string

  • 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