Vue v-calendar date-picker min

by kabanoki

HTML

<link rel="stylesheet" href="https://unpkg.com/v-calendar/lib/v-calendar.min.css">
<script src="https://unpkg.com/v-calendar"></script>
    <div id='app'>
      <v-date-picker 
              :input-props="{ class: 'input', name: 'event_dates'}"
              :mode="mode" 
              :formats="formats" 
              v-model="selectedDate"
              :min-date='minDate'
              is-inline  
              ></v-date-picker>      
    </div>
     <script src="https://momentjs.com/downloads/moment.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
   <script src="https://unpkg.com/[email protected]/lib/v-calendar.umd.min.js"></script>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#app {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  transition: all 0.2s;
  text-align:center;
}

h2 {
  font-weight: bold;
  margin-bottom: 15px;
}

p {
  margin-top: 1em;
}

Vue

var minDate = new Date();
minDate.setDate(minDate.getDate() - 30);

new Vue({
  el: '#app',
  data: {
    mode: 'single',
    formats: {
        input: ['YYYY-MM-DD'],
    },
    selectedDate: null,
    minDate: minDate,
  }
})