UNPKG

tdesign-mobile-vue

Version:
38 lines (34 loc) 1.07 kB
/** * tdesign v1.7.0 * (c) 2024 TDesign Group * @license MIT */ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray'; import _slicedToArray from '@babel/runtime/helpers/slicedToArray'; import isArray from 'lodash/isArray'; var getMeaningColumn = function getMeaningColumn(mode) { var arr = ["year", "month", "date", "hour", "minute", "second"]; if (isArray(mode)) { var ans = []; var _mode = _slicedToArray(mode, 2), dateMode = _mode[0], timeMode = _mode[1]; if (dateMode != null) { var cutIndex2 = arr.indexOf(dateMode); if (cutIndex2 <= 2 && cutIndex2 > -1) { ans.push.apply(ans, _toConsumableArray(arr.slice(0, cutIndex2 + 1))); } } if (timeMode != null) { var _cutIndex = arr.indexOf(timeMode); if (_cutIndex > 2) { ans.push.apply(ans, _toConsumableArray(arr.slice(3, _cutIndex + 1))); } } return ans; } var cutIndex = arr.indexOf(mode); return arr.slice(0, cutIndex + 1); }; export { getMeaningColumn }; //# sourceMappingURL=shared.js.map