Skip to content

Commit bac0965

Browse files
committed
Minor tweeks
1 parent 8faa137 commit bac0965

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/screens/settings_screen.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,16 @@ class _SettingsScreenState extends State<SettingsScreen> {
678678
final wasUploaded = _uploadedFiles.contains(file.path);
679679
// First file (index 0) is the most recent/active log - can't upload
680680
final isCurrentLog = index == 0;
681+
// Parse unix timestamp from filename (meshmapper-debug-{timestamp}.txt)
682+
final timestampMatch = RegExp(r'meshmapper-debug-(\d+)\.txt').firstMatch(filename);
683+
final fileDate = timestampMatch != null
684+
? DateTime.fromMillisecondsSinceEpoch(int.parse(timestampMatch.group(1)!) * 1000)
685+
: null;
686+
final dateStr = fileDate != null ? DateFormat('MMM d, h:mm a').format(fileDate) : filename;
681687

682688
return ListTile(
683689
leading: const Icon(Icons.description, size: 20),
684-
title: Text(filename, style: const TextStyle(fontSize: 13)),
690+
title: Text(dateStr, style: const TextStyle(fontSize: 13)),
685691
subtitle: Text(
686692
isCurrentLog ? '$sizeKb KB (current)' : '$sizeKb KB',
687693
style: const TextStyle(fontSize: 11),

0 commit comments

Comments
 (0)