vankov1
vankov1

Reputation: 71

Is there a way to specify first-day-of-week for Vuetify Date picker globally?

Is there a way to specify first-day-of-week for Vuetify Date picker globally? I don't want to specify the props on each separately.

Upvotes: 1

Views: 4898

Answers (2)

vintprox
vintprox

Reputation: 1141

As for few other components' defaults, you can simply wrap it in new component (let's call it MyDatePicker) and use that one across the application instead.

To harness all event handlers intended for Vuetify component VDatePicker upon your custom MyDatePicker, you'll need to add v-on="$listeners".

Upvotes: 0

Daniel
Daniel

Reputation: 35684

No, there isn't a way to do that

You have to use the widget as per documentation (https://vuetifyjs.com/en/components/date-pickers) with the first-day-of-week property.

<v-date-picker
  v-model="picker"
  :first-day-of-week="1"
></v-date-picker>

if you look into code, you'll notice that the param default is 0, so there's no magical global setting for this.

https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VDatePicker/VDatePicker.ts#L64

Upvotes: 6

Related Questions