diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 84c98fb..bb00ed4 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -31,7 +31,8 @@ // Fetch actions for the current day from PocketBase const today = new Date().toISOString().split('T')[0]; const result = await pb.collection('actions').getList(1, 50, { - filter: `timestamp >= '${today}'` + filter: `timestamp >= '${today}'`, + sort: 'timestamp' }); // Assuming the items are in the 'items' property of the result diff --git a/src/routes/calendar/+page.svelte b/src/routes/calendar/+page.svelte index d103f2c..747232d 100644 --- a/src/routes/calendar/+page.svelte +++ b/src/routes/calendar/+page.svelte @@ -13,7 +13,9 @@ import { onMount } from 'svelte'; async function fetchAllActions() { // Fetch all actions. Adjust as needed for date range or pagination - const result = await pb.collection('actions').getList(1, 1000); + const result = await pb.collection('actions').getList(1, 1000,{ + sort: 'timestamp' + }); return result.items; } diff --git a/src/routes/stats/+page.svelte b/src/routes/stats/+page.svelte index d61654e..3d28d4b 100644 --- a/src/routes/stats/+page.svelte +++ b/src/routes/stats/+page.svelte @@ -23,7 +23,9 @@ async function fetchAllActions() { // Fetch all actions. Adjust as needed for date range or pagination - const result = await pb.collection('actions').getList(1, 1000); + const result = await pb.collection('actions').getList(1, 1000, { + sort: 'timestamp' + }); return result.items; }