<template>
  <div class="ws-state-datetime">
    <date-picker
      :value="_value"
      :format="format"
      type="datetime"
      @input="$emit('input',$moment($event).format(format))"
    ></date-picker>
  </div>
</template>

<script>
export default {
  props: {
    clearable: {
      type: Boolean,
      default: true,
    },
    value: {},
    placeholder: {
      type: String,
      default: "選擇日期",
    },
    format: {
      type: String,
      default: "YYYY-MM-DD HH:mm:ss",
    },
  },
  computed:{
    _value(){
      return new Date(this.value)
    }
  },
  methods: {
    customFormatter(date) {
      return this.$moment(date).format(this.format);
    },
  },
  components: {
  },
};
</script>

<style lang="scss">
@import "../assets/scss/ws-state-datetime.scss";
</style>