@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
15 lines (14 loc) • 674 B
JavaScript
"use client";
import { secondsToTime, timeToSeconds } from "../time-to-seconds/time-to-seconds.mjs";
//#region packages/@mantine/dates/src/components/TimePicker/utils/get-time-range/get-time-range.ts
function getTimeRange({ startTime, endTime, interval }) {
const timeRange = [];
const startInSeconds = timeToSeconds(startTime);
const endInSeconds = timeToSeconds(endTime);
const intervalInSeconds = timeToSeconds(interval);
for (let current = startInSeconds; current <= endInSeconds; current += intervalInSeconds) timeRange.push(secondsToTime(current).timeString);
return timeRange;
}
//#endregion
export { getTimeRange };
//# sourceMappingURL=get-time-range.mjs.map