// Makes sure that date is between min and max dates, returns a cloned min or max
function moveToWithinRange(date, min, max) {
  if (min && date < min) {
    return new Date(min);
  }
  if (max && date > max) {
    return new Date(max);
  }
  return date;
}

export { moveToWithinRange };
//# sourceMappingURL=moveToWithinRange.mjs.map
