Commit 5ca5a6eb98c406374a154f7192e9b87d64bfb144
1 parent
309912df
compute calendar so we react on showWeekNumbers changes
fixes #3277
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
src/components/date-picker/base/date-table.vue
@@ -36,10 +36,8 @@ | @@ -36,10 +36,8 @@ | ||
36 | }, | 36 | }, |
37 | }, | 37 | }, |
38 | data () { | 38 | data () { |
39 | - const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); | ||
40 | return { | 39 | return { |
41 | prefixCls: prefixCls, | 40 | prefixCls: prefixCls, |
42 | - calendar: new jsCalendar.Generator({onlyDays: !this.showWeekNumbers, weekStart: weekStartDay}) | ||
43 | }; | 41 | }; |
44 | }, | 42 | }, |
45 | computed: { | 43 | computed: { |
@@ -51,6 +49,10 @@ | @@ -51,6 +49,10 @@ | ||
51 | } | 49 | } |
52 | ]; | 50 | ]; |
53 | }, | 51 | }, |
52 | + calendar(){ | ||
53 | + const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); | ||
54 | + return new jsCalendar.Generator({onlyDays: !this.showWeekNumbers, weekStart: weekStartDay}); | ||
55 | + }, | ||
54 | headerDays () { | 56 | headerDays () { |
55 | const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); | 57 | const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); |
56 | const translatedDays = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(item => { | 58 | const translatedDays = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(item => { |