clamp
import { clamp } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// What is Mar, 21, 2021 bounded to an interval starting at Mar, 22, 2021 and ending at Apr, 01, 2021
const result = clamp(new Date(2021, 2, 21), {
start: new Date(2021, 2, 22),
end: new Date(2021, 3, 1),
})
//=> Mon Mar 22 2021 00:00:00
function clamp<DateType extends Date>(date: DateType | number | string, interval: Interval): DateType | Date;