Skip to content

Commit

Permalink
Calendar : Fix weekdays i18n issue (ElemeFE#16772)
Browse files Browse the repository at this point in the history
  • Loading branch information
ubitoffee authored and oleksiikhr committed Jan 13, 2020
1 parent b369abd commit 443a151
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/calendar/src/date-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,6 +20,12 @@ export default {
inject: ['elCalendar'],
data() {
return {
WEEK_DAYS: getI18nSettings().dayNames
};
},
methods: {
toNestedArr(days) {
return rangeArr(days.length / 7).map((_, index) => {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 443a151

Please sign in to comment.