diff options
| author | diogo464 <[email protected]> | 2025-08-11 16:52:19 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-11 16:52:19 +0100 |
| commit | 951e817ca45c075e17bd0870539f659cc1627f0b (patch) | |
| tree | 8e14f63a4ce62513103a8a58b0ed49afdf887d48 | |
| parent | 9e85f30c31a510b9d4dc2fb67534d86f4dac6d53 (diff) | |
Add time with seconds to info dialog modified field
- Add formatDateTime function to show full timestamp
- Display modification time as "YYYY-MM-DD at HH:MM:SS"
- Keep formatDate for table display (date only)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
| -rw-r--r-- | frontend/file-drive.tsx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/frontend/file-drive.tsx b/frontend/file-drive.tsx index d59d7c9..7a59def 100644 --- a/frontend/file-drive.tsx +++ b/frontend/file-drive.tsx | |||
| @@ -70,6 +70,19 @@ function formatDate(timestamp: number): string { | |||
| 70 | return new Date(timestamp * 1000).toISOString().split('T')[0] // YYYY-MM-DD | 70 | return new Date(timestamp * 1000).toISOString().split('T')[0] // YYYY-MM-DD |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | // Convert UNIX timestamp to date and time string | ||
| 74 | function formatDateTime(timestamp: number): string { | ||
| 75 | const date = new Date(timestamp * 1000) | ||
| 76 | const dateStr = date.toISOString().split('T')[0] // YYYY-MM-DD | ||
| 77 | const timeStr = date.toLocaleTimeString('en-US', { | ||
| 78 | hour12: false, | ||
| 79 | hour: '2-digit', | ||
| 80 | minute: '2-digit', | ||
| 81 | second: '2-digit' | ||
| 82 | }) | ||
| 83 | return `${dateStr} at ${timeStr}` | ||
| 84 | } | ||
| 85 | |||
| 73 | export default function FileDrive() { | 86 | export default function FileDrive() { |
| 74 | const [files, setFiles] = useState<DriveTreeNode[]>([]) | 87 | const [files, setFiles] = useState<DriveTreeNode[]>([]) |
| 75 | const [loading, setLoading] = useState(true) | 88 | const [loading, setLoading] = useState(true) |
| @@ -569,7 +582,7 @@ export default function FileDrive() { | |||
| 569 | </div> | 582 | </div> |
| 570 | <div> | 583 | <div> |
| 571 | <Label className="text-sm font-medium text-muted-foreground">Modified</Label> | 584 | <Label className="text-sm font-medium text-muted-foreground">Modified</Label> |
| 572 | <p className="text-sm">{formatDate(currentItem.lastmod)}</p> | 585 | <p className="text-sm">{formatDateTime(currentItem.lastmod)}</p> |
| 573 | </div> | 586 | </div> |
| 574 | <div> | 587 | <div> |
| 575 | <Label className="text-sm font-medium text-muted-foreground">Modified By</Label> | 588 | <Label className="text-sm font-medium text-muted-foreground">Modified By</Label> |
