UNPKG

vremel

Version:

JavaScript date utility library for Temporal API

12 lines 751 B
import type { Interval, Temporal } from "../types.js"; /** * Returns a datetime object clamped within the given interval. * * When the given datetime is earlier than the start of the interval, the start will be returned. * * When the given datetime is later than the end of the interval, the end will be returned. * * Otherwise the given datetime will be returned. * @param dateTime datetime object * @param interval interval * @returns clamped datetime object */ export declare function clamp<DateTime extends Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.PlainYearMonth>(dateTime: DateTime, interval: Interval<DateTime>): DateTime; //# sourceMappingURL=clamp.d.ts.map