mengxiong10 / vue2-datepicker

A datepicker / datetimepicker component for Vue2
https://mengxiong10.github.io/vue2-datepicker/index.html
MIT License
1.51k stars 405 forks source link

Custom css class or titles for disabled dates #683

Closed Matvej17 closed 2 years ago

Matvej17 commented 2 years ago

Hi guys,

I use your datepicker, it is great. Thank you.

I have one guestion, maybe idea for next feature.

Is posibble in disabled-date function somehow add for individual days custom class and custom title ? I was looking for something like that, but I couldn't find it.

It's good, for example, to be able to distinguish between types of reservations.

Have a nice day guys and thanks for your reply.

mengxiong10 commented 2 years ago

You can use prop getClasses

<date-picker :get-classes="getClasses" />
{
  methods: {
    disabledDate(date) {}
    getClasses (date) {
        if (this.isdisabledDate(date)) {
             return 'custom-class'
        }
    }
  }
}