Remove the All/AM/PM filter buttons and part_of_day param from
the routines list page — date-based sorting/filtering is preferred.
Add missing keyed {#each} blocks across all pages to follow
Svelte 5 best practice (dashboard, products, medications,
lab results, routines list and detail, skin).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
441 B
TypeScript
14 lines
441 B
TypeScript
import { getRoutines } from '$lib/api';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
export const load: PageServerLoad = async ({ url }) => {
|
|
const from_date = url.searchParams.get('from_date') ?? recentDate(30);
|
|
const routines = await getRoutines({ from_date });
|
|
return { routines };
|
|
};
|
|
|
|
function recentDate(daysAgo: number): string {
|
|
const d = new Date();
|
|
d.setDate(d.getDate() - daysAgo);
|
|
return d.toISOString().slice(0, 10);
|
|
}
|