Skip to main content

CommonFormatDuration

Callable

  • CommonFormatDuration(ms: number, 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.

    @deprecated

    Use CommonFormatDurationRange instead


    Parameters

    • ms: number
    • 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