Calendar : Fix weekdays i18n issue (#16772)

pull/17105/head
SeongYeob Jeong 2019-08-06 17:15:47 +09:00 committed by hetech
parent b8e96b35a1
commit 0734dc7960
1 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,6 @@
import fecha from 'element-ui/src/utils/date';
import { range as rangeArr, getFirstDayOfMonth, getPrevMonthLastDays, getMonthDays, getI18nSettings, validateRangeInOneMonth } from 'element-ui/src/utils/date-util';
const WEEK_DAYS = getI18nSettings().dayNames;
export default {
props: {
selectedDay: String, // formated date yyyy-MM-dd
@ -21,6 +20,12 @@ export default {
inject: ['elCalendar'],
data() {
return {
WEEK_DAYS: getI18nSettings().dayNames
};
},
methods: {
toNestedArr(days) {
return rangeArr(days.length / 7).map((_, index) => {
@ -142,6 +147,8 @@ export default {
weekDays() {
const start = this.firstDayOfWeek;
const { WEEK_DAYS } = this;
if (typeof start !== 'number' || start === 0) {
return WEEK_DAYS.slice();
} else {