V-calendar: How to disable the days that has already passed?

Created on 27 Feb 2018  路  5Comments  路  Source: nathanreyes/v-calendar

Hello All.

Have you figured out how to disabled the days that have already passed?

Thanks

Most helpful comment

@lmatab The concept of a min-date doesn't really exist for v-calendar, so I would try @luiztsmelo suggestion by using your own custom attribute.

All 5 comments

<v-date-picker
  :min-date='new Date().getTime()'>
</v-date-picker>

Hello luiztsmel, Thanks for the feedback.

I need to use it with the v-calendar component instead the v-date-picker.

it looks like :min-date='new Date().getTime()' only works for the v-date-picker

Thanks

I don't know if it's the best way, but you can try thinking like this:

<v-calendar
  :attributes='attributes'>
</v-calendar>
attributes: [
        {
          key: 'disabledDates',
          contentStyle: {
            textDecoration: 'line-through',
            opacity: .3
          },
          dates: {
            start: null, // From the beginning of time
            end: new Date().setDate(new Date().getDate() - 1) // Until yesterday
          }
        }
      ],

@lmatab The concept of a min-date doesn't really exist for v-calendar, so I would try @luiztsmelo suggestion by using your own custom attribute.

Thanks a lot @luiztsmelo , thanks a lot @nathanreyes , that worked nicely.

Thanks a lot for your time to answer this question.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sokolovdm picture sokolovdm  路  3Comments

felixfrtz picture felixfrtz  路  3Comments

thfontaine picture thfontaine  路  3Comments

redraw picture redraw  路  3Comments

Maadtin picture Maadtin  路  3Comments