Options
All
  • Public
  • Public/Protected
  • All
V1.7
  • V1.6
  • V1.7
Menu

Class Date

Simple Date class with access to year/month/day

Hierarchy

  • Date

Index

Constructors

constructor

  • new Date(year: number, month: number, day: number): Date
  • new Date(): Date

Methods

day

  • day(): number

getDaysPerMonth

  • getDaysPerMonth(): number
  • Gets the amount of days in this Date object's month.

    Returns number

    amount of days in this Date's month.

isLeapYear

  • isLeapYear(): boolean
  • Determines whether this Date object's year is a leap year.

    Returns boolean

    true if it is a leap year, false otherwise.

month

  • month(): number

setDay

  • setDay(day: number): void
  • Sets the day. Clamping will be applied for out of range values.

    Parameters

    • day: number

      day to be set in the range 1-31.

    Returns void

setMonth

  • setMonth(month: number): void
  • Sets the month. Clamping will be applied for out of range values.

    Parameters

    • month: number

      month to be set in the range of 1-12.

    Returns void

setYear

  • setYear(year: number): void
  • Sets the year. Clamping will be applied for out of range values.

    Parameters

    • year: number

      year in the range of -9999, 9999.

    Returns void

year

  • year(): number

Static GetCurrentDate

  • GetCurrentDate(): Date

Static GetDaysPerMonth

  • GetDaysPerMonth(month: number): number
  • To get the amount of days in an arbitrary month

    Parameters

    • month: number

      1 - 12

    Returns number

    amount of days in specified month

Static IsLeapYear

  • IsLeapYear(year: number): boolean
  • To determine whether the passed in year is a leap year

    Parameters

    • year: number

      the year

    Returns boolean

    true if it is a leap year, false otherwise.

Generated using TypeDoc