ts-playground
    Preparing search index...

    Function computeUseUnits

    • Compute the units to use (include +1 unit for rounding)

      Parameters

      • args: {
            min:
                | "years"
                | "months"
                | "weeks"
                | "days"
                | "hours"
                | "minutes"
                | "seconds"
                | "milliseconds";
            nums: number;
            top: | "years"
            | "months"
            | "weeks"
            | "days"
            | "hours"
            | "minutes"
            | "seconds"
            | "milliseconds";
        }
        • min:
              | "years"
              | "months"
              | "weeks"
              | "days"
              | "hours"
              | "minutes"
              | "seconds"
              | "milliseconds"

          the minimum unit to use

        • nums: number

          the number of units to use

        • top:
              | "years"
              | "months"
              | "weeks"
              | "days"
              | "hours"
              | "minutes"
              | "seconds"
              | "milliseconds"

          the most significant unit

      Returns (
          | "years"
          | "months"
          | "weeks"
          | "days"
          | "hours"
          | "minutes"
          | "seconds"
          | "milliseconds"
      )[]