@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
13 lines (12 loc) • 656 B
JavaScript
"use client";
const require_time_to_seconds = require("../time-to-seconds/time-to-seconds.cjs");
//#region packages/@mantine/dates/src/components/TimePicker/utils/clamp-time/clamp-time.ts
function clampTime(time, min, max) {
const timeInSeconds = require_time_to_seconds.timeToSeconds(time);
const minInSeconds = min ? require_time_to_seconds.timeToSeconds(min) : -Infinity;
const maxInSeconds = max ? require_time_to_seconds.timeToSeconds(max) : Infinity;
return require_time_to_seconds.secondsToTime(Math.max(minInSeconds, Math.min(timeInSeconds, maxInSeconds)));
}
//#endregion
exports.clampTime = clampTime;
//# sourceMappingURL=clamp-time.cjs.map