Navigate to events log from calendar.

* When clicking on a date, shows events for that date.

* When clicking on a sequence, shows that sequence's events.
This commit is contained in:
D. Berge
2020-08-12 15:18:32 +02:00
parent 4de0684919
commit 3dcb55393a

View File

@@ -79,6 +79,8 @@
:locale-first-day-of-year="4"
:weekdays="weekdays"
:show-week="true"
@click:date="showLogForDate"
@click:event="showLogForEvent"
></v-calendar>
</v-sheet>
</div>
@@ -129,6 +131,7 @@ export default {
const e = {};
//e.start = s.ts0.substring(0,10)+" "+s.ts0.substring(11,19)
//e.end = s.ts1.substring(0,10)+" "+s.ts1.substring(11,19)
e.routerLink = { name: "logBySequence", params: { sequence: s.sequence } };
e.start = new Date(s.ts0);
e.end = new Date(s.ts1);
e.timed = true;
@@ -164,6 +167,16 @@ export default {
this.$refs.calendar.next()
},
showLogForDate ({ date }) {
this.$router.push({name: "logByDate", params: {date0: date}});
},
showLogForEvent ({event}) {
if (event.routerLink) {
this.$router.push(event.routerLink);
}
},
...mapActions(["api"])