/**
 * tdesign v0.46.4
 * (c) 2022 tdesign
 * @license MIT
 */

import dayjs from 'dayjs';

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.js.map
