From af6a7c488e7250ec5afe03e0e9ff4c53787496f8 Mon Sep 17 00:00:00 2001 From: Danny Spangenberg Date: Wed, 11 Oct 2017 17:38:03 +0200 Subject: [PATCH] weekStartDay did not influence the order of the weekdays in the header --- src/components/date-picker/base/date-table.vue | 12 +++++++++++- yarn.lock | 0 2 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 yarn.lock diff --git a/src/components/date-picker/base/date-table.vue b/src/components/date-picker/base/date-table.vue index a8a64c5..aa66e28 100644 --- a/src/components/date-picker/base/date-table.vue +++ b/src/components/date-picker/base/date-table.vue @@ -3,7 +3,9 @@ :class="classes" @mousemove="handleMouseMove">
- {{ t('i.datepicker.weeks.sun') }}{{ t('i.datepicker.weeks.mon') }}{{ t('i.datepicker.weeks.tue') }}{{ t('i.datepicker.weeks.wed') }}{{ t('i.datepicker.weeks.thu') }}{{ t('i.datepicker.weeks.fri') }}{{ t('i.datepicker.weeks.sat') }} + + {{day}} +
{{ cell.text }} @@ -87,6 +89,14 @@ `${prefixCls}` ]; }, + headerDays () { + const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); + const translatedDays = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(item => { + return this.t('i.datepicker.weeks.' + item); + }) + const weekDays = translatedDays.splice(weekStartDay, 7 - weekStartDay).concat(translatedDays.splice(0, weekStartDay)); + return weekDays; + }, cells () { const date = new Date(this.year, this.month, 1); const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); diff --git a/yarn.lock b/yarn.lock old mode 100644 new mode 100755 index 3707aab..3707aab --- a/yarn.lock +++ b/yarn.lock -- libgit2 0.21.4