Search code examples
datevuejs2vuetify.js

v-text-field type=date: restrict future dates


I've seen a lot of post about how to restrict future dates with v-date-picker, but how can I do the same thing but with a v-text-field that has a type of date? I dont want to add the v-date-picker bc aesthetically it doesn't work with my page.

Ex: I have

<v-text-field
   v-model="start"
   type="date"
   label="Start Date">
</v-text-field>

Is there a property or something to add to the v-text-field that will restrict future dates from being selected? Any insight would be appreciated. Thanks


Solution

  • It's same as you specifying a future date on regular html input.

    <v-text-field max="2026-09-13" v-model="start" type="date" label="Start Date">
    

    That will be restrict your input type date to 2026-09-13, use max attribute for do it.