feat: calendar support firstDayOfWeek (#6468)

This commit is contained in:
yeliex
2020-07-14 11:51:27 +08:00
committed by GitHub
parent 63aa6baa86
commit 5febb845d0
8 changed files with 89 additions and 2 deletions
+10 -1
View File
@@ -27,6 +27,7 @@ export default createComponent({
allowSameDay: Boolean,
showSubtitle: Boolean,
showMonthTitle: Boolean,
firstDayOfWeek: Number,
},
data() {
@@ -41,7 +42,15 @@ export default createComponent({
},
offset() {
return this.date.getDay();
const { firstDayOfWeek } = this;
const realDay = this.date.getDay();
if (!firstDayOfWeek) {
return realDay;
}
return (realDay + 7 - this.firstDayOfWeek) % 7;
},
totalDay() {