Skip to content

Commit

Permalink
fix auto choose 1st of month when switch month
Browse files Browse the repository at this point in the history
  • Loading branch information
付登荣 committed Aug 4, 2019
1 parent d729e03 commit 332471e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/component/calendar/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,10 @@ const conf = {
item.choosed = false;
}
});
const tmp = { 'calendar.days': days };
if (curDate) {
tmp['calendar.selectedDay'] = selectedDay;
}
setData(tmp);
setData({
'calendar.days': days,
'calendar.selectedDay': selectedDay || []
});
},
/**
* 当改变月份时触发
Expand Down Expand Up @@ -1006,8 +1005,6 @@ const conf = {
conf.selectedDayWeekAllDays(day || currentDay);
} else {
Component.weekMode = false;
let { year, month, day } = currentDay;
if (curYear !== year || curMonth !== month) day = 1;
setData({
'calendar.weekMode': false
});
Expand Down

0 comments on commit 332471e

Please sign in to comment.