Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit 71b7b3c

Browse files
committed
Fix current month's notation. Fixes: #228.
1 parent e917282 commit 71b7b3c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/DatetimeCalendar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<path fill="none" stroke="#444" stroke-width="14" stroke-miterlimit="10" d="M56.3 97.8L9.9 51.4 56.3 5"/>
77
</svg>
88
</div>
9-
<div class="vdatetime-calendar__current--month">{{ monthName }} {{ newYear }}</div>
9+
<div class="vdatetime-calendar__current--month">{{ yearMonth }}</div>
1010
<div class="vdatetime-calendar__navigation--next" @click="nextMonth">
1111
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 61.3 102.8">
1212
<path fill="none" stroke="#444" stroke-width="14" stroke-miterlimit="10" d="M56.3 97.8L9.9 51.4 56.3 5"/>
@@ -66,15 +66,15 @@ export default {
6666
},
6767
6868
computed: {
69+
yearMonth () {
70+
return this.newDate.toLocaleString({ year: 'numeric', month: 'long' })
71+
},
6972
newYear () {
7073
return this.newDate.year
7174
},
7275
newMonth () {
7376
return this.newDate.month
7477
},
75-
monthName () {
76-
return this.months[this.newMonth - 1]
77-
},
7878
days () {
7979
return monthDays(this.newYear, this.newMonth, this.weekStart).map(day => ({
8080
number: day,

test/specs/DatetimeCalendar.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('DatetimeCalendar.vue', function () {
3030
components: { DatetimeCalendar }
3131
})
3232

33-
expect(vm.$('.vdatetime-calendar__current--month')).to.have.text('Julio 2018')
33+
expect(vm.$('.vdatetime-calendar__current--month')).to.have.text('julio de 2018')
3434

3535
const weekdays = vm.$$('.vdatetime-calendar__month__weekday').map(el => el.textContent)
3636
expect(weekdays).deep.equal(['Lun.', 'Mar.', 'Mié.', 'Jue.', 'Vie.', 'Sáb.', 'Dom.'])

0 commit comments

Comments
 (0)