Make commit history easier to scan and review (#2146)
* feat(app): improve commit history and diff review * fix(app): keep commit timestamps current * fix(app): pause hidden commit clocks * fix(app): reopen commit diff in persistence test
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
* Format a date as a human-friendly relative time string
|
||||
* Examples: "just now", "5m ago", "2h ago", "3d ago", "Jan 15"
|
||||
*/
|
||||
export function formatTimeAgo(date: Date): string {
|
||||
const now = new Date();
|
||||
export function formatTimeAgo(date: Date, now: Date = new Date()): string {
|
||||
const diffMs = now.getTime() - date.getTime();
|
||||
const diffSec = Math.floor(diffMs / 1000);
|
||||
const diffMin = Math.floor(diffSec / 60);
|
||||
|
||||
Reference in New Issue
Block a user