aminmokhtari94 / vue-persian-calendar

41 stars 15 forks source link

unclickable Days with event #27

Closed amirahmadihr closed 1 year ago

amirahmadihr commented 2 years ago

hi there, the event on-day-click (as you said in doc) dont work. please check and resolve the prob ty

d4rkr3pt0r commented 1 year ago

@amirahmadihr As you may see in the source file, to activate on-day-click you should pass :disablePastDays="true" and clicked day shouldn't be before of the current day.

    emitDay(day, $event) {
      if (this.disablePastDays) {
        if (!day.isBefore(this.$moment(), 'day')) {
          this.$emit('on-day-click', day);
        } else {
          $event.stopPropagation();
        }
      }
    }