Skip to content

Commit

Permalink
Merge pull request charliekassel#370 from smilee/master
Browse files Browse the repository at this point in the history
Switch month and year depending on the selected language
  • Loading branch information
charliekassel authored Dec 24, 2017
2 parents fad5946 + fbeebda commit d022ac5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
@click="isRtl ? nextMonth() : previousMonth()"
class="prev"
v-bind:class="{ 'disabled' : isRtl ? nextMonthDisabled(pageTimestamp) : previousMonthDisabled(pageTimestamp) }">&lt;</span>
<span @click="showMonthCalendar" :class="allowedToShowView('month') ? 'up' : ''">{{ currMonthName }} {{ currYear }}
</span>
<span @click="showMonthCalendar" :class="allowedToShowView('month') ? 'up' : ''">{{ isYmd ? currYear : currMonthName }} {{ isYmd ? currMonthName : currYear }}</span>
<span
@click="isRtl ? previousMonth() : nextMonth()"
class="next"
Expand Down Expand Up @@ -318,6 +317,9 @@ export default {
},
isRtl () {
return this.translation.rtl === true
},
isYmd () {
return this.translation.ymd === true
}
},
methods: {
Expand Down
6 changes: 6 additions & 0 deletions src/utils/DateLanguages.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default {
},
'ja': {
'language': 'Japanese',
'ymd': true,
'months': {
'original': ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
'abbr': ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
Expand All @@ -132,6 +133,7 @@ export default {
},
'hu': {
'language': 'Hungarian',
'ymd': true,
'months': {
'original': ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
'abbr': ['Jan', 'Febr', 'Márc', 'Ápr', 'Máj', 'Jún', 'Júl', 'Aug', 'Szept', 'Okt', 'Nov', 'Dec']
Expand Down Expand Up @@ -180,6 +182,7 @@ export default {
},
'ko': {
'language': 'Korean',
'ymd': true,
'months': {
'original': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
'abbr': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
Expand All @@ -188,6 +191,7 @@ export default {
},
'lt': {
'language': 'Lithuanian',
'ymd': true,
'months': {
'original': ['Sausis', 'Vasaris', 'Kovas', 'Balandis', 'Gegužė', 'Birželis', 'Liepa', 'Rugpjūtis', 'Rugsėjis', 'Spalis', 'Lapkritis', 'Gruodis'],
'abbr': ['Sau', 'Vas', 'Kov', 'Bal', 'Geg', 'Bir', 'Lie', 'Rugp', 'Rugs', 'Spa', 'Lap', 'Gru']
Expand All @@ -204,6 +208,7 @@ export default {
},
'mn': {
'language': 'Mongolia',
'ymd': true,
'months': {
'original': ['1 дүгээр сар', '2 дугаар сар', '3 дугаар сар', '4 дүгээр сар', '5 дугаар сар', '6 дугаар сар', '7 дугаар сар', '8 дугаар сар', '9 дүгээр сар', '10 дугаар сар', '11 дүгээр сар', '12 дугаар сар'],
'abbr': ['1-р сар', '2-р сар', '3-р сар', '4-р сар', '5-р сар', '6-р сар', '7-р сар', '8-р сар', '9-р сар', '10-р сар', '11-р сар', '12-р сар']
Expand Down Expand Up @@ -333,6 +338,7 @@ export default {
},
'zh': {
'language': 'Chinese',
'ymd': true,
'months': {
'original': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
'abbr': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
Expand Down

0 comments on commit d022ac5

Please sign in to comment.