UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

24 lines (20 loc) 593 B
/** * xdesign v1.0.6 * (c) 2023 xdesign * @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