Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IFilterDate

Hierarchy

  • IFilterDate

Callable

  • __call(date: Date | number | string, format?: string, timezone?: string): string
  • Formats date to a string based on the requested format.

    Parameters

    • date: Date | number | string

      Date to format either as Date object, milliseconds (string or number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is specified in the string input, the time is considered to be in the local timezone.

    • Optional format: string

      Formatting rules (see Description). If not specified, mediumDate is used.

    • Optional timezone: string

      Timezone to be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations, but for general use, use a time zone offset, for example, '+0430' (4 hours, 30 minutes east of the Greenwich meridian) If not specified, the timezone of the browser will be used.

    Returns string

    Formatted string or the input if input is not recognized as date/millis.

Generated using TypeDoc