UNPKG

tdesign-vue-next

Version:
41 lines (37 loc) 1.27 kB
/** * tdesign v1.15.2 * (c) 2025 tdesign * @license MIT */ import { isObject } from 'lodash-es'; import dayjs from 'dayjs'; import { b as isEnabledDate } from '../../_chunks/dep-ffe2e63e.js'; import '@babel/runtime/helpers/slicedToArray'; import '@babel/runtime/helpers/objectDestructuringEmpty'; import '@babel/runtime/helpers/extends'; import '@babel/runtime/helpers/defineProperty'; import '../../_chunks/dep-7fac49fa.js'; import '../../_chunks/dep-eda9a75f.js'; import '../../_chunks/dep-d665296e.js'; import '../../_chunks/dep-0ffe4637.js'; function useDisableDate(props) { var _disableDate = props.disableDate, format = props.format, mode = props.mode, start = props.start, end = props.end; return { disableDate: function disableDate(value) { return !isEnabledDate({ disableDate: _disableDate, format: format, mode: mode, value: value }); }, minDate: isObject(_disableDate) && "before" in _disableDate ? new Date(dayjs(_disableDate.before).startOf("day").format()) : start, maxDate: isObject(_disableDate) && "after" in _disableDate ? new Date(dayjs(_disableDate.after).endOf("day").format()) : end }; } export { useDisableDate }; //# sourceMappingURL=useDisableDate.js.map