<template>
  <span>{{ redirectIsActive }}</span>
</template>
<script>
export default {
  props: {
    item: {
      type: Object
    }
  },
  computed: {
    redirectIsActive() {
      const currentDate = Date.now();
      const startDate = new Date(this.item['$item'].startDate).getTime();
      const endDate = this.item['$item'].endDate ? new Date(this.item['$item'].endDate).getTime() : null;

      if (startDate <= currentDate && (endDate >= currentDate || endDate == null)) {
        return 'Ja';
      } else if (startDate > currentDate || endDate < currentDate) {
        return 'Nee';
      }
      return 'onbekend';
    }
  }
};
</script>
