UNPKG

tdesign-vue-next

Version:
42 lines (38 loc) 1.31 kB
/** * tdesign v1.19.2 * (c) 2026 tdesign * @license MIT */ import { isObject } from 'lodash-es'; import dayjs from 'dayjs'; import { b as isEnabledDate } from '../../_chunks/dep-43987ea8.js'; import '@babel/runtime/helpers/slicedToArray'; import '@babel/runtime/helpers/objectDestructuringEmpty'; import '@babel/runtime/helpers/extends'; import '@babel/runtime/helpers/defineProperty'; import '../../_chunks/dep-f0f392fb.js'; import '../../_chunks/dep-4d62a805.js'; import '../../_chunks/dep-4c859e6d.js'; import '../../_chunks/dep-dc276a19.js'; import '../../_chunks/dep-06660d60.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