UNPKG

tdesign-vue-next

Version:
42 lines (38 loc) 1.31 kB
/** * tdesign v1.20.2 * (c) 2026 tdesign * @license MIT */ import { isObject } from 'lodash-es'; import dayjs from 'dayjs'; import { b as isEnabledDate } from '../../_chunks/dep-95cbb664.js'; import '@babel/runtime/helpers/slicedToArray'; import '@babel/runtime/helpers/objectDestructuringEmpty'; import '@babel/runtime/helpers/extends'; import '@babel/runtime/helpers/defineProperty'; import '../../_chunks/dep-a6042a25.js'; import '../../_chunks/dep-0515d3ee.js'; import '../../_chunks/dep-4c391d32.js'; import '../../_chunks/dep-954c2fab.js'; import '../../_chunks/dep-2721b80a.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