fix(cortex): update date handling in API and UI components

- Adjusted date handling in the agenda API to ensure optional parameters for start, end, and label are correctly processed.
- Enhanced chat input and action parser to support optional date labels for relative dates.
- Updated agenda components to handle date ranges and loading states more effectively.
- Improved error handling and loading indicators in the agenda block for better user experience.

This commit ensures consistency in date handling across the application, aligning with the new requirements for relative date inputs.
This commit is contained in:
colinislit
2026-01-02 09:21:37 +01:00
parent 011815072b
commit 52e07aaf80
20 changed files with 2092 additions and 65 deletions

View File

@@ -42,10 +42,11 @@ export async function GET(request: NextRequest) {
}
// Parse and validate query parameters
// Note: searchParams.get() returns null if not present, but Zod expects undefined
const searchParams = request.nextUrl.searchParams;
const start = searchParams.get('start');
const end = searchParams.get('end');
const label = searchParams.get('label');
const start = searchParams.get('start') ?? undefined;
const end = searchParams.get('end') ?? undefined;
const label = searchParams.get('label') ?? undefined;
const validation = QuerySchema.safeParse({ start, end, label });
if (!validation.success) {