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

import { d as dayjs } from '../../../_chunks/dep-9888611c.mjs';
import '../../../_chunks/dep-255303ba.mjs';
import '../../../_chunks/dep-eba0ea6e.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
