Function formatDate

  • Formats a date to a string using the specified format string.

    Parameters

    • date: RawDate

      The date to format

    • dateFnsFormat: string

      The format string to use for formatting the date

    Returns string

    A string representing the formatted date using the specified format string

    Example

    formatDate(new Date(), 'MMM dd, yyyy');
    // => 'Jan 01, 2022'

    formatDate('2022-01-01T12:00:00Z', 'MMM dd');
    // => 'Jan 01'

Generated using TypeDoc