Skip to content

Commit e40a74c

Browse files
committed
feat: display timestamps with the users timezone
1 parent 512f0fa commit e40a74c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ui/chat.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
use std::collections::{HashSet, HashMap, VecDeque};
1818
use std::io::Stdout;
1919

20-
use ratatui::{
20+
use chrono::Local;
21+
use ratatui:{
2122
backend::CrosstermBackend,
2223
buffer::Buffer,
2324
layout::Rect,
@@ -239,10 +240,12 @@ impl ChatView {
239240
),
240241
};
241242

243+
// Convert UTC timestamp to local time for display
244+
let local_time = turn.timestamp.with_timezone(&Local);
242245
let header = Line::from(vec![
243246
Span::styled(role_text, role_style),
244247
Span::styled(
245-
format!(" ({})", turn.timestamp.format("%H:%M:%S")),
248+
format!(" ({})", local_time.format("%H:%M:%S")),
246249
Style::default().fg(Color::DarkGray),
247250
),
248251
]);

0 commit comments

Comments
 (0)