[Vuejs]-Vue js: show data from JSON that has date of today only

0👍

Try this. It will only show if the date is the same. Otherwise you can filter your data before displaying it.

<div v-for="(inst, index2) in find.installments" :key="index2">
  <b-row v-if="inst.date == new Date()">
    <b-col>
      <h4
        :class="{
          'text-green': inst.is_paid == true,
          'text-red': inst.is_paid == 'false'
        }"
      >
        {{ inst.amount }}$
      </h4>
    </b-col>

    <b-col style="left:30px !important;">
      <h4
        :class="{
          'text-green': inst.is_paid == true,
          'text-red': inst.is_paid == 'false'
        }"
      >
        {{ inst.date }}
      </h4>
    </b-col>
  </b-row>
</div>

Leave a comment