Looking for a way to display date headlines in a list without duplicating them when multiple dates are the same.
For example, currently:
01.02.2019
- XY
05.03.2019
- ABC
05.03.2019
- DEF
05.03.2019
- FOO
Desired output:
01.02.2019
- XY
05.03.2019
- ABC
- DEF
- FOO
Here's the code snippet I'm using to check if the date is today:
HTML:
<template v-for="(meetup, index) in filteredItems">
<v-subheader v-if="checkIsToday(meetup.date)" inset>
<span v-if="todaySubheader === false">TODAY</span>
</v-subheader>
Javascript:
data() {
return {
todaySubheader: false,
[...]
checkIsToday(val) {
if (val && this.todaySubheader === false) {
this.todaySubheader = true
}
return isToday(new Date(val))
},
Any suggestions on preventing the addition of a second headline after one has already been set?
(Using VueJS with Vuetify framework)