L
L
Little Vasya2019-03-29 20:58:05
JavaScript
Little Vasya, 2019-03-29 20:58:05

Can't display enable Days in Flatpickr calendar?

I use the https://flatpickr.js.org/ plugin in my project, the task is next. you need to turn everything on. days .. I know that in his config there is an `enable` object where it accepts a callback, in principle I output it as it should, but for some reason on Sunday. not displayed .. itself starts from 0
calendar config

configs: {
        locale: Russian,
        enable: [
          date => {
            return this.enableDays.find(i => Number(i) === date.getDay())
          }
        ],
        // minDate: 'today',
        dateFormat: "j F - l, Y"
      }

I display dates through props
<app-datepicker :enableDays="[2, 4, 0]" v-model="order.date" placeholder="25-01-1990" border />

Sunday disabled
5c9e5ca453796539486628.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Little Vasya, 2019-03-29
@emilov

The problem was solved, it was necessary to supplement the conditions

this.enableDays.find(i => Number(i) === date.getDay() || date.getDay() === 0)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question