I'm displaying a conflict marker for each actor for each day, if the current day is in their conflicts.
<li v-for="date in next_three_months">
<template v-for="actor in cast">
<template v-for="conflict in actor.conflicts">
<i v-if="date.datestamp==conflict.datestamp" class="is-conflict"></i>
</template>
</template>
</li>
This works... it just feels like a lot of code (despite it already being a dozen or so lines shorter than how I was doing it before using Vue JS).
Here's my Vue.js:
new Vue({
el: '#schedule-builder',
data: {
cast: [
{{ cast_list }}
{
actor: {
id: "{{ actor_id }}",
name: "{{ actor_name or 'TBD' }}",
},
conflicts: [
{{ conflict_calendar }}
{ datestamp: "{{ value }}" },
{{ /conflict_calendar }}
],
},
{{ /cast_list }}
],
next_three_months: [
{
datestamp: '{{ now | format:Y-m-d }}',
},
{{ loop times="90" }}
{
datestamp: '{{ now | modify_date:+1 day | format:Y-m-d }}',
},
{{ /loop }}
],