Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DateTime

Implements

Index

Constructors

constructor

  • Returns DateTime

  • Parameters

    • dateString: string
    • Optional kind: Kind

    Returns DateTime

  • Parameters

    • milliseconds: number
    • Optional kind: Kind

    Returns DateTime

  • Parameters

    • source: Date
    • Optional kind: Kind

    Returns DateTime

  • Parameters

    Returns DateTime

Properties

Private _kind

_kind: Kind

Private _time

_time: ClockTime

Private _value

_value: Date

Accessors

date

  • Returns a DateTime object for 00:00 of this date.

    Returns DateTime

day

  • get day(): number
  • Returns the day of the month. An integer between 1 and 31.

    Returns number

dayOfWeek

  • Returns DayOfWeek

kind

  • Returns Kind

month

  • Returns the Gregorian Month (zero indexed).

    Returns Month

timeOfDay

  • Returns the time of day represented by a ClockTime object.

    Returns ClockTime

toUniversalTime

  • Returns a UTC version of this date if its kind is local.

    Returns DateTime

year

  • get year(): number
  • Returns number

Static now

  • Returns the now local time.

    Returns DateTime

Static today

  • The date component for now.

    Returns DateTime

Static tomorrow

  • Midnight tomorrow.

    Returns DateTime

Methods

Private _setJsDate

  • _setJsDate(value: Date): void
  • Parameters

    • value: Date

    Returns void

add

  • Receives an ITimeQuantity value and adds based on the total milliseconds.

    Parameters

    Returns DateTime

addDays

  • Parameters

    • days: number

    Returns DateTime

addHours

  • Parameters

    • hours: number

    Returns DateTime

addMilliseconds

  • Parameters

    • ms: number

    Returns DateTime

addMinutes

  • Parameters

    • minutes: number

    Returns DateTime

addMonths

  • Parameters

    • months: number

    Returns DateTime

addSeconds

  • Parameters

    • seconds: number

    Returns DateTime

addYears

  • Parameters

    • years: number

    Returns DateTime

subtract

  • Receives an ITimeQuantity value and subtracts based on the total milliseconds.

    Parameters

    Returns DateTime

timePassedSince

  • Returns a TimeSpan representing the amount of time between two dates.

    Parameters

    Returns TimeSpan

toJsDate

  • toJsDate(): Date
  • Returns Date

toTimeStamp

  • Returns a readonly object which contains all the date and time components.

    Returns ITimeStamp

Static between

  • Measures the difference between two dates as a TimeSpan.

    Parameters

    Returns TimeSpan

Static daysInMonth

  • daysInMonth(year: number, month: Month): number
  • Returns the number of days for the specific year and month.

    Parameters

    • year: number
    • month: Month

    Returns number

Static isLeapYear

  • isLeapYear(year: number): boolean
  • Calculates if the given year is a leap year using the formula: ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)

    Parameters

    • year: number

    Returns boolean

Generated using TypeDoc