V-calendar: How to set the previous days to be grey?

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

I use the calendar,
How can i set the previous days 'color:grey' and can't click?

Most helpful comment

You can change style with attributes option like below. But you need to handle click event by yourself.

{ dates: { start: null, end: new Date() }, contentStyle: { color: 'grey' }}

All 5 comments

You can disable dates using the min-date, max-date or disabled-dates properties.
You can find that in the docs.

i do not use the date-picker, only use the calendar.
i select days by the event dayclick.
it's my code

<calendar
        :theme-styles='themeStyles'
        :attributes='attrs'
        :min-date="new Date()"
        title-position="center"
        show-caps
        @update:frompage="pageChange"
        @dayclick="dayclick"
        >
        </calendar>

the min-date,max-date or disable-dates only work in month ,the day also can click

You can change style with attributes option like below. But you need to handle click event by yourself.

{ dates: { start: null, end: new Date() }, contentStyle: { color: 'grey' }}

Thanks a lot,I think it's the best solution now.

@EricMcRay Thanks for the help there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

redraw picture redraw  路  3Comments

maksnester picture maksnester  路  3Comments

Maadtin picture Maadtin  路  3Comments

Nadavrbn picture Nadavrbn  路  3Comments

garygreen picture garygreen  路  3Comments