Skip to main content

CommonFormatDurationRange

Callable

  • CommonFormatDurationRange(end: number | Date, start: number | Date, options?: { includeDays?: boolean; includeHours?: boolean; includeMinutes?: boolean; includeMonths?: boolean; includeSeconds?: boolean; includeWeeks?: boolean; includeYears?: boolean; showFull?: boolean }): string

  • Formats a duration in ms to a human readable string of days, months, and years. Defaults to showing days.


    Parameters

    • end: number | Date
    • start: number | Date
    • options: { includeDays?: boolean; includeHours?: boolean; includeMinutes?: boolean; includeMonths?: boolean; includeSeconds?: boolean; includeWeeks?: boolean; includeYears?: boolean; showFull?: boolean } = {}
      • optionalincludeDays: boolean
      • optionalincludeHours: boolean
      • optionalincludeMinutes: boolean
      • optionalincludeMonths: boolean
      • optionalincludeSeconds: boolean
      • optionalincludeWeeks: boolean
      • optionalincludeYears: boolean
      • optionalshowFull: boolean

    Returns string