Function prettyIsoDateString

  • Converts an ISO date string into a more readable format.

    Parameters

    • iso: string = ...

      The ISO date string to be converted. Defaults to the current date and time.

    • dateTimeSeparator: string = '_'

      The character to use as a separator between the date and time. Defaults to '_'.

    • precision: "year" | "month" | "day" | "hour" | "minute" | "second" | "millisecond" = 'millisecond'

      The level of precision for the date and time. Can be 'year', 'month', 'day', 'hour', 'minute', 'second', or 'millisecond'. Defaults to 'millisecond'.

    Returns string

    The converted date string.

    Example

    prettyIsoDateString('2020-02-03T14:01:04.437Z', '_', 'minute');
    //=> 2020.02.03_14.01

Generated using TypeDoc