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

current month's notation has been changed. #229

Open
wants to merge 1 commit into
base: v1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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