Update date formatting logic and replace binary assets

- Enhanced the formatDate function to handle date strings without timezone information by treating them as UTC.
- Updated binary assets including screenshots and application images for improved visual representation.
This commit is contained in:
Jamie Pine
2026-01-26 01:10:22 -08:00
parent b7ab4410a6
commit 47e4da7ce2
5 changed files with 16 additions and 1 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 187 KiB

+16 -1
View File
@@ -7,7 +7,22 @@ export function formatDuration(seconds: number): string {
}
export function formatDate(date: string | Date): string {
return formatDistance(new Date(date), new Date(), { addSuffix: true });
// Parse the date string - if it doesn't have timezone info, treat it as UTC
let dateObj: Date;
if (typeof date === 'string') {
// If the string doesn't end with Z or have timezone offset, assume it's UTC
const dateStr = date.trim();
if (!dateStr.includes('Z') && !dateStr.match(/[+-]\d{2}:\d{2}$/)) {
// No timezone info, treat as UTC
dateObj = new Date(dateStr + 'Z');
} else {
dateObj = new Date(dateStr);
}
} else {
dateObj = date;
}
return formatDistance(dateObj, new Date(), { addSuffix: true }).replace(/^about /i, '');
}
export function formatFileSize(bytes: number): string {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 KiB

After

Width:  |  Height:  |  Size: 860 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.