hookehuyr

fix 日期控件的月份计算问题处理,月份从0开始需要+1

1 <!-- 1 <!--
2 * @Date: 2022-08-31 11:45:30 2 * @Date: 2022-08-31 11:45:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-13 15:54:10 4 + * @LastEditTime: 2024-06-13 17:52:57
5 * @FilePath: /data-table/src/components/DatePickerField/index.vue 5 * @FilePath: /data-table/src/components/DatePickerField/index.vue
6 * @Description: 日期选择组件 6 * @Description: 日期选择组件
7 --> 7 -->
...@@ -82,7 +82,7 @@ onMounted(() => { ...@@ -82,7 +82,7 @@ onMounted(() => {
82 let Day = ''; 82 let Day = '';
83 if (!props.item.component_props.default) { 83 if (!props.item.component_props.default) {
84 Year = String(dayjs().year()); 84 Year = String(dayjs().year());
85 - Month = formatZero(dayjs().month(), 2); 85 + Month = formatZero(dayjs().month()+1, 2);
86 Day = formatZero(dayjs().date(), 2); 86 Day = formatZero(dayjs().date(), 2);
87 } else { 87 } else {
88 Year = currentDate.value[0]; 88 Year = currentDate.value[0];
......
1 <!-- 1 <!--
2 * @Date: 2022-09-08 15:02:45 2 * @Date: 2022-09-08 15:02:45
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-13 15:56:40 4 + * @LastEditTime: 2024-06-13 17:53:14
5 * @FilePath: /data-table/src/components/DateTimePickerField/index.vue 5 * @FilePath: /data-table/src/components/DateTimePickerField/index.vue
6 * @Description: 日期时间选择器 6 * @Description: 日期时间选择器
7 --> 7 -->
...@@ -91,7 +91,7 @@ onMounted(() => { ...@@ -91,7 +91,7 @@ onMounted(() => {
91 let Day = ''; 91 let Day = '';
92 if (!props.item.component_props.default) { 92 if (!props.item.component_props.default) {
93 Year = String(dayjs().year()); 93 Year = String(dayjs().year());
94 - Month = formatZero(dayjs().month(), 2); 94 + Month = formatZero(dayjs().month()+1, 2);
95 Day = formatZero(dayjs().date(), 2); 95 Day = formatZero(dayjs().date(), 2);
96 } else { 96 } else {
97 Year = currentDate.value[0]; 97 Year = currentDate.value[0];
......