styling & filtering
This commit is contained in:
parent
080b6a2b78
commit
faadc71b1b
3 changed files with 11 additions and 7 deletions
|
@ -75,7 +75,6 @@
|
|||
<select id="date" ref="date" value="" required>
|
||||
<option value="" disabled>Datum wählen</option>
|
||||
<option v-for="cal in filteredCalendar" :key="cal.id" :value="cal.id">
|
||||
{{ cal.title }}
|
||||
{{
|
||||
cal.allDay
|
||||
? new Date(cal.starttime).toLocaleDateString("de-DE", {
|
||||
|
@ -91,6 +90,8 @@
|
|||
minute: "2-digit",
|
||||
})
|
||||
}}
|
||||
-
|
||||
{{ cal.title }}
|
||||
</option>
|
||||
</select>
|
||||
<button type="submit" primary class="!w-fit">hinzufügen</button>
|
||||
|
@ -124,7 +125,9 @@ export default defineComponent({
|
|||
...mapState(useCalendarStore, ["calendars"]),
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
filteredCalendar() {
|
||||
return this.calendars.filter((c) => !this.dates.map((d) => d.calendarId).includes(c.id));
|
||||
return this.calendars.filter(
|
||||
(c) => !this.dates.map((d) => d.calendarId).includes(c.id) && new Date(c.starttime) >= new Date()
|
||||
);
|
||||
},
|
||||
sortedDates() {
|
||||
return this.dates.sort(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue