Class DateUtils

Index

Methods

Static convertToStandardDate

  • convertToStandardDate(date: any): Date
  • Parameters

    • date: any

    Returns Date

    The parsed Date object, or Invalid Date if the date argument was not recognized as a valid date.

Static dateForQuery

  • dateForQuery(date: Date): string
  • Parameters

    • date: Date

    Returns string

    A string corresponding to the date argument value, in the YYYY/MM/DD format.

Static dateTimeForQuery

  • dateTimeForQuery(date: Date): string
  • Parameters

    • date: Date

    Returns string

    A string corresponding to the date argument value, in the YYYY/MM/DD@HH:mm:ss format.

Static dateTimeToString

Static dateToString

Static isValid

  • isValid(date: any): boolean
  • Parameters

    • date: any

    Returns boolean

    true if the date argument is an instance of Date; false otherwise.

Static keepOnlyDatePart

  • keepOnlyDatePart(date: Date): Date
  • Parameters

    • date: Date

    Returns Date

    A cropped Date object corresponding to the date argument value, excluding its time information.

Static monthToString

  • monthToString(month: number): string
  • Parameters

    • month: number

    Returns string

    A string whose value is the localized name of the corresponding month.

Static offsetDateByDays

  • offsetDateByDays(date: Date, offset: number): Date
  • Parameters

    • date: Date
    • offset: number

    Returns Date

    An offset Date object corresponding to the date argument value plus the offset value.

Static timeBetween

  • timeBetween(from: Date, to: Date): string
  • Parameters

    • from: Date
    • to: Date

    Returns string

    A string whose value corresponds to the amount of time between from and to, or an empty string if either argument was undefined.

Static timeToString

  • Parameters

    Returns string

    A string containing the time information of the date argument, and formatted according to the specified options.

Hierarchy

  • DateUtils