refactor: open timings

This commit is contained in:
Barf-Vader
2025-06-13 13:18:53 +01:00
parent e96aeb2cfc
commit 268392deed
4 changed files with 116 additions and 25 deletions

View File

@@ -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 () => {