element-plus
Version: 
A Component Library for Vue 3
40 lines (37 loc) • 1.17 kB
JavaScript
import '../../../utils/index2.mjs';
import '../../time-picker/index2.mjs';
import { rangeArr } from '../../time-picker/src/common/date-utils2.mjs';
import { buildProps, definePropType } from '../../../utils/vue/props2.mjs';
import { isObject } from '@vue/shared';
const getPrevMonthLastDays = (date, count) => {
  const lastDay = date.subtract(1, "month").endOf("month").date();
  return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
};
const getMonthDays = (date) => {
  const days = date.daysInMonth();
  return rangeArr(days).map((_, index) => index + 1);
};
const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
  const start = index * 7;
  return days.slice(start, start + 7);
});
const dateTableProps = buildProps({
  selectedDay: {
    type: definePropType(Object)
  },
  range: {
    type: definePropType(Array)
  },
  date: {
    type: definePropType(Object),
    required: true
  },
  hideHeader: {
    type: Boolean
  }
});
const dateTableEmits = {
  pick: (value) => isObject(value)
};
export { dateTableEmits, dateTableProps, getMonthDays, getPrevMonthLastDays, toNestedArr };
//# sourceMappingURL=date-table3.mjs.map