vue3-calendar icon indicating copy to clipboard operation
vue3-calendar copied to clipboard

How to hide previous months?

Open FrancescoMussi opened this issue 7 years ago • 2 comments

Hello. Great component. Just one question:

Is it possible to hide all the months (and years) previous than the current one?

FrancescoMussi avatar Apr 13 '18 15:04 FrancescoMussi

or you can simply return the click handler when clicked on month previous than current one. @click="monthSelect(stringifyYearHeader(currDate, pan), $index)" or add a compute function to judge the month is visible or not. <template v-for="(m, $index) in text.months"> <span :key="m" :id="m" :class="{'datepicker-dateRange-item-hidden': isHidden(m)}" ></span></template>

alex2wong avatar May 25 '18 03:05 alex2wong

Or you can just disable days for < minDate || > maxDate...

<calendar
  :pane="1"
  :hasInput="false"
  :showDateOnly="true"
  :on-day-click="onDayClick"
  :format="dateFormat"
  :value="dateValue"
  :change-pane="changePane"
  :minDate="'2018-06-01'" <===
  :maxDate="'2019-06-01'" <===
>

dschinnerl avatar Jun 27 '18 04:06 dschinnerl