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

Commit

Permalink
Fix current month's notation. Fixes: #228.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikuosaito1989 committed Jun 25, 2020
1 parent e917282 commit 71b7b3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/DatetimeCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<path fill="none" stroke="#444" stroke-width="14" stroke-miterlimit="10" d="M56.3 97.8L9.9 51.4 56.3 5"/>
</svg>
</div>
<div class="vdatetime-calendar__current--month">{{ monthName }} {{ newYear }}</div>
<div class="vdatetime-calendar__current--month">{{ yearMonth }}</div>
<div class="vdatetime-calendar__navigation--next" @click="nextMonth">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 61.3 102.8">
<path fill="none" stroke="#444" stroke-width="14" stroke-miterlimit="10" d="M56.3 97.8L9.9 51.4 56.3 5"/>
Expand Down Expand Up @@ -66,15 +66,15 @@ export default {
},
computed: {
yearMonth () {
return this.newDate.toLocaleString({ year: 'numeric', month: 'long' })
},
newYear () {
return this.newDate.year
},
newMonth () {
return this.newDate.month
},
monthName () {
return this.months[this.newMonth - 1]
},
days () {
return monthDays(this.newYear, this.newMonth, this.weekStart).map(day => ({
number: day,
Expand Down
2 changes: 1 addition & 1 deletion test/specs/DatetimeCalendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('DatetimeCalendar.vue', function () {
components: { DatetimeCalendar }
})

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

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

0 comments on commit 71b7b3c

Please sign in to comment.