Commit 8168d14e authored by 好多大米's avatar 好多大米 Committed by GitHub

Calendar: fix first-day-of-week (#21057)

parent 9a4b758b
...@@ -124,7 +124,8 @@ export default { ...@@ -124,7 +124,8 @@ export default {
let firstDay = getFirstDayOfMonth(date); let firstDay = getFirstDayOfMonth(date);
firstDay = firstDay === 0 ? 7 : firstDay; firstDay = firstDay === 0 ? 7 : firstDay;
const firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1; const firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
const prevMonthDays = getPrevMonthLastDays(date, firstDay - firstDayOfWeek).map(day => ({ const offset = (7 + firstDay - firstDayOfWeek) % 7;
const prevMonthDays = getPrevMonthLastDays(date, offset).map(day => ({
text: day, text: day,
type: 'prev' type: 'prev'
})); }));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment