Do not watch tests & fix time formatting

This commit is contained in:
2026-04-25 19:12:35 +02:00
parent 192432f8e5
commit 2136c10f69
3 changed files with 17 additions and 2 deletions
+15
View File
@@ -110,3 +110,18 @@ export function timeToMinutes(timeStr: string): number {
const [hours, minutes] = timeStr.split(":").map(Number);
return hours * 60 + minutes;
}
/**
* Convert total minutes to a human-readable string (e.g., "1h 30m" or "45m")
* @param totalMinutes - Total number of minutes
* @returns Formatted string
*/
export function formatMinutes(totalMinutes: number): string {
const hours = Math.floor(totalMinutes / 60);
const mins = totalMinutes % 60;
if (hours > 0) {
return `${hours}h ${mins}m`;
}
return `${mins}m`;
}