UNPKG

@qvant/qui-max

Version:

A Vue 3 Design system for Web.

15 lines (14 loc) 526 B
import toDate from "../toDate/index.js"; import requiredArgs from "../_lib/requiredArgs/index.js"; function isWithinInterval(dirtyDate, interval) { requiredArgs(2, arguments); var time = toDate(dirtyDate).getTime(); var startTime = toDate(interval.start).getTime(); var endTime = toDate(interval.end).getTime(); if (!(startTime <= endTime)) { throw new RangeError("Invalid interval"); } return time >= startTime && time <= endTime; } export { isWithinInterval as default }; //# sourceMappingURL=index.js.map