<template>
  <div class="row q-gutter-x-xs">
   <x-date-input
      outlined
      label="От"
      :options="options"
      :value="from"
      hide-bottom-space
      class="col font-12"
      @input="inputHandler($event, 'from')"
    />
    <x-date-input
      label="До"
      :options="options"
      :value="to"
      hide-bottom-space
      class="col font-12"
      @input="inputHandler($event, 'to')"
    />
    </div>

</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import XDateInput from './x-date-input.vue';

@Component({
  components: { XDateInput },
})
export default class DateApplicationInput extends Vue {
  @Prop() private from!: Date;
  @Prop() private to!: Date;
  @Prop() options: Date;

  private inputHandler($event: any, field: string): void {
    this.$emit(`update:${field}`, $event);
    this.$emit('input', {
      from: this.from,
      to: this.to,
    });
  }
}
</script>
