feat: extract and display event times on timeline (kl. HH:MM etc.)
Prompt now instructs the model to extract time of day (HH:MM) when present in Norwegian formats: kl. 14:30, kl 09.00, 14:30, 14.30. renderTimeline shows time as a muted inline annotation next to the date. CSV export gains a Time column after Date. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -844,6 +844,13 @@ p {
|
|||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.timeline-time {
|
||||||
|
margin-left: 6px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 0.82rem;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
.timeline-actor {
|
.timeline-actor {
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--teal-dark);
|
color: var(--teal-dark);
|
||||||
|
|||||||
+3
-3
@@ -1463,7 +1463,7 @@ function renderTimeline(events) {
|
|||||||
return `
|
return `
|
||||||
<li class="timeline-item confidence-${escapeHtml(conf)}">
|
<li class="timeline-item confidence-${escapeHtml(conf)}">
|
||||||
<div class="timeline-header">
|
<div class="timeline-header">
|
||||||
<strong class="timeline-date">${escapeHtml(ev.date || 'unknown')}</strong>
|
<strong class="timeline-date">${escapeHtml(ev.date || 'unknown')}${ev.time ? `<span class="timeline-time"> ${escapeHtml(ev.time)}</span>` : ''}</strong>
|
||||||
${ev.date_type ? `<span class="date-type-badge">${escapeHtml(ev.date_type)}</span>` : ''}
|
${ev.date_type ? `<span class="date-type-badge">${escapeHtml(ev.date_type)}</span>` : ''}
|
||||||
<span class="confidence-badge confidence-badge--${escapeHtml(conf)}">${escapeHtml(conf)}</span>
|
<span class="confidence-badge confidence-badge--${escapeHtml(conf)}">${escapeHtml(conf)}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1541,9 +1541,9 @@ function setupFeedbackWidget(tool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function exportTimelineCSV(events) {
|
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) => [
|
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 || '',
|
ev.event || '', ev.source_excerpt || '', ev.confidence || '',
|
||||||
]);
|
]);
|
||||||
const csv = [header, ...rows]
|
const csv = [header, ...rows]
|
||||||
|
|||||||
@@ -317,20 +317,23 @@ Build a chronological timeline from the pasted text in {$locale}.
|
|||||||
|
|
||||||
Extract ALL dates, deadlines, milestones, and temporal references.{$focusInstruction}{$backgroundInstruction}
|
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)
|
- 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)
|
- 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)
|
- 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)
|
- D.M. (e.g. 6.1. — day and month only)
|
||||||
- DD.MM.YYYY (e.g. 18.09.2025)
|
- DD.MM.YYYY (e.g. 18.09.2025)
|
||||||
- Two-digit years: always interpret as 20YY (25 → 2025, 24 → 2024).
|
- 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.
|
- 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: "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: "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.
|
- Do NOT skip a line just because the year is ambiguous — record what you can and set confidence accordingly.
|
||||||
|
|
||||||
For each temporal reference provide:
|
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)"
|
- "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
|
- "date_type": one of absolute | relative | recurring | conditional | period
|
||||||
- "actor": person, institution, or party involved — or "unknown"
|
- "actor": person, institution, or party involved — or "unknown"
|
||||||
- "event": concise description of what happened or is due
|
- "event": concise description of what happened or is due
|
||||||
@@ -347,7 +350,7 @@ Pasted text:
|
|||||||
Return JSON only:
|
Return JSON only:
|
||||||
{
|
{
|
||||||
"what_we_found": "short overview",
|
"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":"..."}],
|
"evidence_trail": [{"title":"...","excerpt":"..."}],
|
||||||
"what_remains_uncertain": ["..."],
|
"what_remains_uncertain": ["..."],
|
||||||
"next_practical_step": "..."
|
"next_practical_step": "..."
|
||||||
|
|||||||
Reference in New Issue
Block a user