diff --git a/assets/css/tools.css b/assets/css/tools.css index 3afd4b4..42dca57 100644 --- a/assets/css/tools.css +++ b/assets/css/tools.css @@ -844,6 +844,13 @@ p { font-size: 0.95rem; } +.timeline-time { + margin-left: 6px; + color: var(--muted); + font-size: 0.82rem; + font-weight: 400; +} + .timeline-actor { display: block; color: var(--teal-dark); diff --git a/assets/js/tools.js b/assets/js/tools.js index d70c558..3553555 100644 --- a/assets/js/tools.js +++ b/assets/js/tools.js @@ -1463,7 +1463,7 @@ function renderTimeline(events) { return `
  • - ${escapeHtml(ev.date || 'unknown')} + ${escapeHtml(ev.date || 'unknown')}${ev.time ? ` ${escapeHtml(ev.time)}` : ''} ${ev.date_type ? `${escapeHtml(ev.date_type)}` : ''} ${escapeHtml(conf)}
    @@ -1541,9 +1541,9 @@ function setupFeedbackWidget(tool) { } function exportTimelineCSV(events) { - const header = ['Date', 'Date Type', 'Actor', 'Event', 'Source Excerpt', 'Confidence']; + const header = ['Date', 'Time', 'Date Type', 'Actor', 'Event', 'Source Excerpt', 'Confidence']; const rows = events.map((ev) => [ - ev.date || '', ev.date_type || '', ev.actor || '', + ev.date || '', ev.time || '', ev.date_type || '', ev.actor || '', ev.event || '', ev.source_excerpt || '', ev.confidence || '', ]); const csv = [header, ...rows] diff --git a/includes/LegalTools.php b/includes/LegalTools.php index 78745bd..b60a46a 100644 --- a/includes/LegalTools.php +++ b/includes/LegalTools.php @@ -317,20 +317,23 @@ Build a chronological timeline from the pasted text in {$locale}. Extract ALL dates, deadlines, milestones, and temporal references.{$focusInstruction}{$backgroundInstruction} -IMPORTANT — Norwegian date formats to recognise: +IMPORTANT — Norwegian date and time formats to recognise: - DD.MM.YY (e.g. 18.09.25 = 2025-09-18, 09.04.25 = 2025-04-09) - D.M.YY (e.g. 6.1.25 = 2025-01-06) - DD.MM. (e.g. 18.09. — day and month without year; infer year from surrounding context) - D.M. (e.g. 6.1. — day and month only) - DD.MM.YYYY (e.g. 18.09.2025) - Two-digit years: always interpret as 20YY (25 → 2025, 24 → 2024). +- Times: "kl. 14:30", "kl 09.00", "14:30", "14.30" → extract as "14:30" (HH:MM 24-hour). - Diary / log format: lines that begin with a date followed by a colon or space are ALWAYS events. Example: "18.09.25: Samtale med Davids lærer" → date 2025-09-18, event "Samtale med Davids lærer". Example: "6.1. Samtaler med David" → date unknown-year-01-06, event "Samtaler med David". + Example: "18.09.25 kl. 09.00: Møte på skolen" → date 2025-09-18, time "09:00", event "Møte på skolen". - Do NOT skip a line just because the year is ambiguous — record what you can and set confidence accordingly. For each temporal reference provide: - "date": ISO 8601 date (YYYY-MM-DD) if determinable, otherwise a human-readable description such as "06 Jan (year unknown)" +- "time": time of day in HH:MM (24-hour) if present in the source text, otherwise null - "date_type": one of absolute | relative | recurring | conditional | period - "actor": person, institution, or party involved — or "unknown" - "event": concise description of what happened or is due @@ -347,7 +350,7 @@ Pasted text: Return JSON only: { "what_we_found": "short overview", - "events": [{"date":"...","date_type":"absolute","actor":"...","event":"...","source_excerpt":"...","confidence":"high|medium|low"}], + "events": [{"date":"...","time":"HH:MM or null","date_type":"absolute","actor":"...","event":"...","source_excerpt":"...","confidence":"high|medium|low"}], "evidence_trail": [{"title":"...","excerpt":"..."}], "what_remains_uncertain": ["..."], "next_practical_step": "..."