Skip to content

Commit d022ac5

Browse files
Merge pull request charliekassel#370 from smilee/master
Switch month and year depending on the selected language
2 parents fad5946 + fbeebda commit d022ac5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/components/Datepicker.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
@click="isRtl ? nextMonth() : previousMonth()"
4040
class="prev"
4141
v-bind:class="{ 'disabled' : isRtl ? nextMonthDisabled(pageTimestamp) : previousMonthDisabled(pageTimestamp) }">&lt;</span>
42-
<span @click="showMonthCalendar" :class="allowedToShowView('month') ? 'up' : ''">{{ currMonthName }} {{ currYear }}
43-
</span>
42+
<span @click="showMonthCalendar" :class="allowedToShowView('month') ? 'up' : ''">{{ isYmd ? currYear : currMonthName }} {{ isYmd ? currMonthName : currYear }}</span>
4443
<span
4544
@click="isRtl ? previousMonth() : nextMonth()"
4645
class="next"
@@ -318,6 +317,9 @@ export default {
318317
},
319318
isRtl () {
320319
return this.translation.rtl === true
320+
},
321+
isYmd () {
322+
return this.translation.ymd === true
321323
}
322324
},
323325
methods: {

src/utils/DateLanguages.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default {
115115
},
116116
'ja': {
117117
'language': 'Japanese',
118+
'ymd': true,
118119
'months': {
119120
'original': ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
120121
'abbr': ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
@@ -132,6 +133,7 @@ export default {
132133
},
133134
'hu': {
134135
'language': 'Hungarian',
136+
'ymd': true,
135137
'months': {
136138
'original': ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
137139
'abbr': ['Jan', 'Febr', 'Márc', 'Ápr', 'Máj', 'Jún', 'Júl', 'Aug', 'Szept', 'Okt', 'Nov', 'Dec']
@@ -180,6 +182,7 @@ export default {
180182
},
181183
'ko': {
182184
'language': 'Korean',
185+
'ymd': true,
183186
'months': {
184187
'original': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
185188
'abbr': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
@@ -188,6 +191,7 @@ export default {
188191
},
189192
'lt': {
190193
'language': 'Lithuanian',
194+
'ymd': true,
191195
'months': {
192196
'original': ['Sausis', 'Vasaris', 'Kovas', 'Balandis', 'Gegužė', 'Birželis', 'Liepa', 'Rugpjūtis', 'Rugsėjis', 'Spalis', 'Lapkritis', 'Gruodis'],
193197
'abbr': ['Sau', 'Vas', 'Kov', 'Bal', 'Geg', 'Bir', 'Lie', 'Rugp', 'Rugs', 'Spa', 'Lap', 'Gru']
@@ -204,6 +208,7 @@ export default {
204208
},
205209
'mn': {
206210
'language': 'Mongolia',
211+
'ymd': true,
207212
'months': {
208213
'original': ['1 дүгээр сар', '2 дугаар сар', '3 дугаар сар', '4 дүгээр сар', '5 дугаар сар', '6 дугаар сар', '7 дугаар сар', '8 дугаар сар', '9 дүгээр сар', '10 дугаар сар', '11 дүгээр сар', '12 дугаар сар'],
209214
'abbr': ['1-р сар', '2-р сар', '3-р сар', '4-р сар', '5-р сар', '6-р сар', '7-р сар', '8-р сар', '9-р сар', '10-р сар', '11-р сар', '12-р сар']
@@ -333,6 +338,7 @@ export default {
333338
},
334339
'zh': {
335340
'language': 'Chinese',
341+
'ymd': true,
336342
'months': {
337343
'original': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
338344
'abbr': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']

0 commit comments

Comments
 (0)