clamp
Returns the receiver limited to an inclusive [min, max] month range: min if the
receiver is earlier than min, max if later than max, otherwise the receiver.
API Reference
Signature
Parameters
Returns
Returns a Month: min if the receiver is below range, max if above range,
otherwise the receiver. The returned month preserves the day anchor of whichever
value is chosen.
Throws
- Throws if
minis later thanmax.
Agent Contract
Agent Notes
- Prefer
clamp()over manuallt/gtbranching when bounding a single month into a range. clamp()compares by month index only; day anchors never affect the result.Month.min(...)/Month.max(...)are the static helpers for the extremes of a set;clamp()bounds one value into a range.