Skip to content

Commit

Permalink
fix(calendar): 修复周选择时 weekDate 相关报错 (#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
iCheng authored Sep 2, 2023
1 parent fd89379 commit 491c77d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/packages/__VUE/calendar/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<nut-cell
:show-icon="true"
:title="translate('week')"
:desc="date9 ? `${date9[0]}${translate('conjunction')}${date9[1]}` : translate('please')"
:desc="date9.length ? `${date9[0]}${translate('conjunction')}${date9[1]}` : translate('please')"
@click="openSwitch('isVisible9')"
>
</nut-cell>
Expand Down Expand Up @@ -296,7 +296,7 @@ export default defineComponent({
date6: [] as string[],
date7: [] as string[],
date8: '',
date9: ['2020-01-23', '2020-01-26'],
date9: [] as string[],
isVisible1: false,
isVisible2: false,
isVisible3: false,
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/calendaritem/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ export default create({
if ((type == 'range' && state.chooseData.length == 2) || type != 'range') {
let selectData: any = state.chooseData.slice(0);
if (type == 'week') {
if (state.chooseData.length !== 2) {
return;
}
selectData = {
weekDate: [handleWeekDate(state.chooseData[0] as string[]), handleWeekDate(state.chooseData[1] as string[])]
};
Expand Down

0 comments on commit 491c77d

Please sign in to comment.