Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DateTimeObject

Index

Constructors

constructor

  • Parameters

    • Default value dateTimeString: string = ""

    Returns DateTimeObject

    The created instance

Properties

Private _dateTimeString

_dateTimeString: string = ""

Private _dateTimeStringExploded

_dateTimeStringExploded: string[] = []

Methods

Private _explodeISO8601String

  • _explodeISO8601String(string: string): string[]
  • Parameters

    • string: string

    Returns string[]

    An array with all the date time values extracted

compareTo

  • Parameters

    Returns 0 | 1 | 2

    0 If the two dateTime values represent the exact same time, 1 if this instance > dateTime or 2 if dateTime > this instance

getDay

  • getDay(): number
  • Returns number

    A value between 1 and 31

getDayOfWeek

  • getDayOfWeek(): void
  • Returns void

    A numeric value between 1 and 7

getFirstDayOfMonth

  • getFirstDayOfMonth(): void
  • Returns void

    A dateTime object representing the first day of month based on the current instance

getHour

  • getHour(): number
  • Returns number

    A value between 0 and 23

getLastDayOfMonth

  • getLastDayOfMonth(): void
  • Returns void

    A dateTime object representing the last day of month based on the current instance

getMicroSecond

  • getMicroSecond(): number
  • Returns number

    A value up to 6 digit

getMiliSecond

  • getMiliSecond(): number
  • Returns number

    A value up to 3 digit

getMinute

  • getMinute(): number
  • Returns number

    A value between 0 and 59

getMonth

  • getMonth(): number
  • Returns number

    A value between 1 and 12

getSecond

  • getSecond(): number
  • Returns number

    A value between 0 and 59

getTimeZoneOffset

  • getTimeZoneOffset(): number
  • Returns number

    The UTC timezone offset in seconds

getYear

  • getYear(): number
  • Returns number

    A 4 digits numeric value

isEqualTo

  • Parameters

    Returns boolean

    True if both dateTime values are equivalent to the exact same date and time

isUTC

  • isUTC(): boolean
  • Returns boolean

    True if the instance timezone is UTC, false if not

setLocalTimeZone

  • setLocalTimeZone(): void
  • Returns void

    This object instance

setUTC

  • setUTC(): this
  • Returns this

    This object instance

toString

  • toString(formatString?: string): string
  • Parameters

    • Default value formatString: string = "Y-M-DTH:N:S.UOffset"

    Returns string

    The dateTime with the specified format.

Static compare

  • Parameters

    Returns 0 | 1 | 2

    0 If the two dateTime values represent the exact same time, 1 if dateTime1 > dateTime2 or 2 if dateTime2 > dateTime1

Static getCurrentDay

  • getCurrentDay(): number
  • Returns number

    The day of month as a value between 1 and 31

Static getCurrentDayOfWeek

  • getCurrentDayOfWeek(): void
  • Returns void

    A numeric value between 1 and 7 (where Sunday is 1, Monday is 2, ...)

Static getCurrentHour

  • getCurrentHour(): number
  • Returns number

    The hour as a value between 0 and 23

Static getCurrentMicroSecond

  • getCurrentMicroSecond(): void
  • Returns void

    The microseconds as a value up to 6 digits

Static getCurrentMiliSecond

  • getCurrentMiliSecond(): number
  • Returns number

    The miliseconds as a value up to 3 digits

Static getCurrentMinute

  • getCurrentMinute(): number
  • Returns number

    The minute as a value between 0 and 59

Static getCurrentMonth

  • getCurrentMonth(): number
  • Returns number

    A value between 1 and 12

Static getCurrentSecond

  • getCurrentSecond(): number
  • Returns number

    The seconds as a value between 0 and 59

Static getCurrentTimeZoneOffset

  • getCurrentTimeZoneOffset(): number
  • Returns number

    The timezone offset as a numeric value in seconds

Static getCurrentYear

  • getCurrentYear(): number
  • Returns number

    A numeric value representing the current year

Static getDayName

  • getDayName(day: number): string
  • Parameters

    • day: number

    Returns string

    The day name in english and with capital letters, like for example: MONDAY, SATURDAY...

Static getMonthName

  • getMonthName(month: number): string
  • Parameters

    • month: number

    Returns string

    the month name in english and with capital letters, like: JANUARY, FEBRUARY, ...

Static isEqual

  • Parameters

    Returns boolean

    True if the date and time values on both elements are the same

Static isValidDateTime

  • Parameters

    Returns boolean

    true if the specified value is ISO 8601 or a DateTimeObject instance, false if value contains invalid information.

Generated using TypeDoc