@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
14 lines (11 loc) • 463 B
JavaScript
'use client';
import { timeToSeconds, secondsToTime } from '../time-to-seconds/time-to-seconds.mjs';
function clampTime(time, min, max) {
const timeInSeconds = timeToSeconds(time);
const minInSeconds = timeToSeconds(min);
const maxInSeconds = timeToSeconds(max);
const clampedSeconds = Math.max(minInSeconds, Math.min(timeInSeconds, maxInSeconds));
return secondsToTime(clampedSeconds);
}
export { clampTime };
//# sourceMappingURL=clamp-time.mjs.map