This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2021-08-18 11:19:24 -07:00
|
|
|
<template>
|
|
|
|
<ul class="list-unstyled mb-0">
|
2021-10-15 09:26:21 -07:00
|
|
|
<li v-for="event in events" class="mb-2">
|
2021-10-27 12:00:45 -07:00
|
|
|
<CalendarEvent :event="event" :year="year.year" range :key="event.name"/>
|
2021-10-15 09:26:21 -07:00
|
|
|
</li>
|
2021-08-18 11:19:24 -07:00
|
|
|
</ul>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { iterateMonth } from '../src/calendar/helpers';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
year: { required: true },
|
|
|
|
month: { required: true },
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
events() {
|
|
|
|
let events = [];
|
2021-10-03 07:37:00 -07:00
|
|
|
for (let day of iterateMonth(this.year.year, this.month)) {
|
|
|
|
for (let event of this.year.eventsByDate[day.toString()] || []) {
|
2021-08-18 11:19:24 -07:00
|
|
|
if (event.isFirstDay(day)) {
|
|
|
|
events.push(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return events;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|