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

Commit c6662ec

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

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/DatetimeCalendar.vue

+4-1
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,6 +66,9 @@ 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
},

test/specs/DatetimeCalendar.spec.js

+1-1
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)