Commit 402dbd315f7e8105fd2243dd8c9bf682019fcf0f
Committed by
GitHub
Merge pull request #1997 from SergioCrisostomo/add-week-start-locale
Add week start (locale setting)
Showing
16 changed files
with
26 additions
and
11 deletions
Show diff stats
src/components/date-picker/base/date-table.vue
@@ -89,8 +89,8 @@ | @@ -89,8 +89,8 @@ | ||
89 | }, | 89 | }, |
90 | cells () { | 90 | cells () { |
91 | const date = new Date(this.year, this.month, 1); | 91 | const date = new Date(this.year, this.month, 1); |
92 | - let day = getFirstDayOfMonth(date); // day of first day | ||
93 | - day = (day === 0 ? 7 : day); | 92 | + const weekStartDay = Number(this.t('i.datepicker.weekStartDay')); |
93 | + const day = (getFirstDayOfMonth(date) || 7) - weekStartDay; // day of first day | ||
94 | const today = clearHours(new Date()); // timestamp of today | 94 | const today = clearHours(new Date()); // timestamp of today |
95 | const selectDay = clearHours(new Date(this.value)); // timestamp of selected day | 95 | const selectDay = clearHours(new Date(this.value)); // timestamp of selected day |
96 | const minDay = clearHours(new Date(this.minDate)); | 96 | const minDay = clearHours(new Date(this.minDate)); |
src/locale/lang/de-DE.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'November', | 33 | month11: 'November', |
34 | month12: 'Dezember', | 34 | month12: 'Dezember', |
35 | year: '', | 35 | year: '', |
36 | + weekStartDay: '1', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'So', | 38 | sun: 'So', |
38 | mon: 'Mo', | 39 | mon: 'Mo', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: 'Keine Daten' | 94 | emptyText: 'Keine Daten' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/en-US.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'November', | 33 | month11: 'November', |
34 | month12: 'December', | 34 | month12: 'December', |
35 | year: '', | 35 | year: '', |
36 | + weekStartDay: '0', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Sun', | 38 | sun: 'Sun', |
38 | mon: 'Mon', | 39 | mon: 'Mon', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: 'No Data' | 94 | emptyText: 'No Data' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/es-ES.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'Noviembre', | 33 | month11: 'Noviembre', |
34 | month12: 'Deciembre', | 34 | month12: 'Deciembre', |
35 | year: 'Año', | 35 | year: 'Año', |
36 | + weekStartDay: '1', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Domingo', | 38 | sun: 'Domingo', |
38 | mon: 'Lunes', | 39 | mon: 'Lunes', |
src/locale/lang/fr-FR.js
src/locale/lang/id-ID.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'November', | 33 | month11: 'November', |
34 | month12: 'Desember', | 34 | month12: 'Desember', |
35 | year: '', | 35 | year: '', |
36 | + weekStartDay: '1', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Min', | 38 | sun: 'Min', |
38 | mon: 'Sen', | 39 | mon: 'Sen', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: 'Tidak ada data' | 94 | emptyText: 'Tidak ada data' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/ja-JP.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: '11 月', | 33 | month11: '11 月', |
34 | month12: '12 月', | 34 | month12: '12 月', |
35 | year: '年', | 35 | year: '年', |
36 | + weekStartDay: '0', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: '日', | 38 | sun: '日', |
38 | mon: '月', | 39 | mon: '月', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: 'データなし' | 94 | emptyText: 'データなし' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/ko-KR.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: '11월', | 33 | month11: '11월', |
34 | month12: '12월', | 34 | month12: '12월', |
35 | year: '년', | 35 | year: '년', |
36 | + weekStartDay: '0', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: '일', | 38 | sun: '일', |
38 | mon: '월', | 39 | mon: '월', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: '데이터 없음' | 94 | emptyText: '데이터 없음' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/pt-BR.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'Novembro', | 33 | month11: 'Novembro', |
34 | month12: 'Dezembro', | 34 | month12: 'Dezembro', |
35 | year: 'Ano', | 35 | year: 'Ano', |
36 | + weekStartDay: '0', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Dom', | 38 | sun: 'Dom', |
38 | mon: 'Seg', | 39 | mon: 'Seg', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: 'Sem dados' | 94 | emptyText: 'Sem dados' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/pt-PT.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'Novembro', | 33 | month11: 'Novembro', |
34 | month12: 'Dezembro', | 34 | month12: 'Dezembro', |
35 | year: 'Ano', | 35 | year: 'Ano', |
36 | + weekStartDay: '1', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Dom', | 38 | sun: 'Dom', |
38 | mon: 'Seg', | 39 | mon: 'Seg', |
src/locale/lang/ru-RU.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'Ноябрь', | 33 | month11: 'Ноябрь', |
34 | month12: 'Декабрь', | 34 | month12: 'Декабрь', |
35 | year: '', | 35 | year: '', |
36 | + weekStartDay: '1', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Вс', | 38 | sun: 'Вс', |
38 | mon: 'Пн', | 39 | mon: 'Пн', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: 'Нет данных' | 94 | emptyText: 'Нет данных' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/sv-SE.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: 'November', | 33 | month11: 'November', |
34 | month12: 'December', | 34 | month12: 'December', |
35 | year: 'År', | 35 | year: 'År', |
36 | + weekStartDay: '1', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: 'Sön', | 38 | sun: 'Sön', |
38 | mon: 'Mån', | 39 | mon: 'Mån', |
src/locale/lang/tr-TR.js
src/locale/lang/vi-VN.js
src/locale/lang/zh-CN.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: '11 月', | 33 | month11: '11 月', |
34 | month12: '12 月', | 34 | month12: '12 月', |
35 | year: '年', | 35 | year: '年', |
36 | + weekStartDay: '0', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: '日', | 38 | sun: '日', |
38 | mon: '一', | 39 | mon: '一', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: '暂无数据' | 94 | emptyText: '暂无数据' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |
src/locale/lang/zh-TW.js
@@ -33,6 +33,7 @@ export default { | @@ -33,6 +33,7 @@ export default { | ||
33 | month11: '11 月', | 33 | month11: '11 月', |
34 | month12: '12 月', | 34 | month12: '12 月', |
35 | year: '年', | 35 | year: '年', |
36 | + weekStartDay: '0', | ||
36 | weeks: { | 37 | weeks: { |
37 | sun: '日', | 38 | sun: '日', |
38 | mon: '一', | 39 | mon: '一', |
@@ -93,4 +94,4 @@ export default { | @@ -93,4 +94,4 @@ export default { | ||
93 | emptyText: '暫無數據' | 94 | emptyText: '暫無數據' |
94 | } | 95 | } |
95 | } | 96 | } |
96 | -}; | ||
97 | \ No newline at end of file | 97 | \ No newline at end of file |
98 | +}; |