Function monthShort

  • Extracts the short name of the month from a given date string.

    Example

    monthShort("07/03/2023")
    // => { ok: true, value: 'Jul' }

    Example

    Handle invalid input:

    monthShort(10)
    // => { ok: false, error: Error('[dates.monthShort] Expected string value as input') }

    Parameters

    • dateStr: string

      The date string to extract the short name of the month from.

    Returns Result<string, Error>

    A Result object with either the short name of the month on success, or an Error object if the input value is not a valid date string.

Generated using TypeDoc v0.24.7