<template>
  <div class="dv-time-control-time-group-item-time-span-time"
       :key="timeSpanIndex"
       :class="{ active: isTimeActive }"></div>
</template>

<script>
export default {
  name: "TimeGroupItemTimeSpanTime",
  inject: ['timeControl'],
  props: {
    timeSpanIndex: null,
    timeGroup: null,
    groupTimeSpanIndex: null
  },
  computed: {
    isTimeActive() {
      const time = this.timeGroup.date.add((this.groupTimeSpanIndex - 1) * this.timeControl.timeSpan + this.timeSpanIndex, this.timeControl.timeUnit);
      return time <= this.timeControl.time;
    }
  }
}
</script>
