zhangyong
2023-08-22 1353e87cb21a4032d585d7404bae9042f2ebcf08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
 
Object.defineProperty(exports, '__esModule', { value: true });
 
require('../../../utils/index.js');
require('../../time-picker/index.js');
var utils = require('../../time-picker/src/utils.js');
var runtime = require('../../../utils/vue/props/runtime.js');
var shared = require('@vue/shared');
 
const getPrevMonthLastDays = (date, count) => {
  const lastDay = date.subtract(1, "month").endOf("month").date();
  return utils.rangeArr(count).map((_, index) => lastDay - (count - index - 1));
};
const getMonthDays = (date) => {
  const days = date.daysInMonth();
  return utils.rangeArr(days).map((_, index) => index + 1);
};
const toNestedArr = (days) => utils.rangeArr(days.length / 7).map((index) => {
  const start = index * 7;
  return days.slice(start, start + 7);
});
const dateTableProps = runtime.buildProps({
  selectedDay: {
    type: runtime.definePropType(Object)
  },
  range: {
    type: runtime.definePropType(Array)
  },
  date: {
    type: runtime.definePropType(Object),
    required: true
  },
  hideHeader: {
    type: Boolean
  }
});
const dateTableEmits = {
  pick: (value) => shared.isObject(value)
};
 
exports.dateTableEmits = dateTableEmits;
exports.dateTableProps = dateTableProps;
exports.getMonthDays = getMonthDays;
exports.getPrevMonthLastDays = getPrevMonthLastDays;
exports.toNestedArr = toNestedArr;
//# sourceMappingURL=date-table.js.map