refactor: open timings
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import Report from "$lib/components/Report.svelte";
|
||||
import Feedback from "$lib/components/Feedback.svelte";
|
||||
import { onMount } from "svelte";
|
||||
import { gmapsLoader, daysOfWeek, formatTime, type Table } from "$lib";
|
||||
import { gmapsLoader, daysOfWeek, formatTime, collectTimings, type Table } from "$lib";
|
||||
import Button from "$lib/components/Button.svelte";
|
||||
import Favourite from "$lib/components/Favourite.svelte";
|
||||
|
||||
@@ -52,20 +52,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Collect all timing entries
|
||||
let timingsPerDay: Record<number, Table<"study_space_hours">[]> = {
|
||||
0: [],
|
||||
1: [],
|
||||
2: [],
|
||||
3: [],
|
||||
4: [],
|
||||
5: [],
|
||||
6: []
|
||||
};
|
||||
|
||||
for (const entry of space.study_space_hours) {
|
||||
timingsPerDay[entry.day_of_week].push(entry);
|
||||
}
|
||||
let timingsPerDay = collectTimings(space.study_space_hours);
|
||||
|
||||
let isFavourite = $state(false);
|
||||
onMount(async () => {
|
||||
|
||||
Reference in New Issue
Block a user