Skip to content

Commit 4acb268

Browse files
committed
Update calendar.js
1 parent bcb874e commit 4acb268

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/components/calendar/calendar.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,8 @@ export const BCalendar = Vue.extend({
386386
return isLocaleRTL(this.computedLocale)
387387
},
388388
context() {
389-
const selectedYMD = this.selectedYMD
389+
const { selectedYMD, activeYMD } = this
390390
const selectedDate = parseYMD(selectedYMD)
391-
const activeYMD = this.activeYMD
392391
const activeDate = parseYMD(activeYMD)
393392
return {
394393
// The current value of the `v-model`
@@ -412,11 +411,10 @@ export const BCalendar = Vue.extend({
412411
// Computed props that return a function reference
413412
dateOutOfRange() {
414413
// Check whether a date is within the min/max range
415-
// returns a new function ref if the pops change
414+
// Returns a new function ref if the pops change
416415
// We do this as we need to trigger the calendar computed prop
417416
// to update when these props update
418-
const min = this.computedMin
419-
const max = this.computedMax
417+
const { computedMin: min, computedMax: max } = this
420418
return date => {
421419
// Handle both `YYYY-MM-DD` and `Date` objects
422420
date = parseYMD(date)
@@ -776,8 +774,7 @@ export const BCalendar = Vue.extend({
776774
},
777775
onClickDay(day) {
778776
// Clicking on a date "button" to select it
779-
const selectedDate = this.selectedDate
780-
const activeDate = this.activeDate
777+
const { selectedDate, activeDate } = this
781778
const clickedDate = parseYMD(day.ymd)
782779
if (!this.disabled && !day.isDisabled && !this.dateDisabled(clickedDate)) {
783780
if (!this.readonly) {

0 commit comments

Comments
 (0)