<script>
import DatePicker from "vue2-datepicker"

export default {
  components: {
    DatePicker
  },
  props: {
    placeholder: {type: String},
    format: {type: String},
    value: {default: new Date()},
    type: {type: String, default: "date"},
    disabled_date: {type: String, default: 'only-this-week'},
    additional_class: {default: ""}
  },
  computed: {
    local_value: {
      get: function () {
        return this.value
      },
      set: function (value) {
        this.$emit('input', value)
      }
    },
  },
  methods: {
    generateDisabledDate(date) {
      console.log(date)
      alert(date)
      const today = new Date();
      switch (this.disabled_date) {
        case '' :
          return null;
        case 'before-today':

        case 'after-today' :
          return;
        case 'before-this-month' :
          return;
        case 'after-this-month' :
          return;
        case 'before-this-week' :
          return;
        case 'after-this-week' :
          return;
        case 'this-month' :
          return;
        case 'this-week' :
          return;
        case 'today' :
          return today;
        case 'only-this-month' :
          return;
        case 'only-this-week' :
          return;
        case 'only-today' :
          return;
      }
    }
  }
}
</script>
<template>
    <date-picker :format="format" v-model="local_value" :type="type" :placeholder="placeholder" :clearable="false"
                 :editable="false" >
      <template slot="icon-calendar">
        <i class="bx bx-calendar"></i>
      </template>
    </date-picker>
</template>
