/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { d as dayjs } from '../../../_chunks/dep-6b4aa943.mjs';
import '../../../_chunks/dep-b4041200.mjs';
import '../../../_chunks/dep-a0b4a044.mjs';

function validateInputValue(value, format) {
  return dayjs(value, format).format(format) === value;
}
function formatInputValue(value, format) {
  return dayjs(value, format).format(format);
}
function closestLookup(availableArr, calcVal, step) {
  if (step <= 1) return calcVal;
  return availableArr.sort(function (a, b) {
    return Math.abs(calcVal + 1 - a) - Math.abs(calcVal + 1 - b);
  })[0];
}

export { closestLookup, formatInputValue, validateInputValue };
//# sourceMappingURL=utils.mjs.map
