UNPKG

tdesign-vue

Version:
42 lines (38 loc) 1.33 kB
/** * tdesign v1.14.1 * (c) 2025 tdesign * @license MIT */ import { isObject } from 'lodash-es'; import dayjs from 'dayjs'; import { isEnabledDate } from '../../_common/js/date-picker/utils.js'; import '@babel/runtime/helpers/slicedToArray'; import '@babel/runtime/helpers/objectDestructuringEmpty'; import '@babel/runtime/helpers/extends'; import '@babel/runtime/helpers/defineProperty'; import '../../_chunks/dep-fdb1b253.js'; import '../../_chunks/dep-84c94da7.js'; import '../../_chunks/dep-655d809c.js'; import '../../_common/js/date-picker/format.js'; import '../../_common/js/log/log.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 as default }; //# sourceMappingURL=useDisableDate.js.map