@fkui/date
    Preparing search index...

    Function clamp

    • Limits a value to be between min and max (inclusive).

      Type Parameters

      Parameters

      • value: T

        The value to limit.

      • min: T

        The lower bound (inclusive).

      • max: T

        The upper bound (inclusive).

      Returns T

      A value between min and max (inclusive).

      const min = FDate.fromIso("2004-08-01");
      const max = FDate.fromIso("2007-05-31");

      clamp(FDate.fromIso("2005-12-31"), min, max); // -> FDate { 2005-12-31 } in range
      clamp(FDate.fromIso("2004-07-31"), min, max); // -> FDate { 2004-08-01 } min
      clamp(FDate.fromIso("2007-06-01"), min, max); // -> FDate { 2007-05-31 } max

      v6.12.0