checkpoint 1

This commit is contained in:
2025-08-22 18:27:12 -07:00
parent 5f0cd85406
commit 6273138a65
19 changed files with 350 additions and 5 deletions

View File

@@ -7,12 +7,13 @@ class Utils {
return new Date(dateStr).toLocaleDateString();
}
// Format duration from seconds to HH:MM
// Format duration from seconds to HH:MM:SS
static formatDuration(seconds) {
if (!seconds) return '-';
const hours = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds % 3600) / 60);
return `${hours}:${minutes.toString().padStart(2, '0')}`;
const secondsLeft = seconds % 60;
return `${hours}:${minutes.toString().padStart(2, '0')}:${secondsLeft.toString().padStart(2, '0')}`;
}
// Format distance from meters to kilometers
@@ -26,6 +27,11 @@ class Utils {
return watts ? `${Math.round(watts)}W` : '-';
}
// Format heart rate (adds 'bpm')
static formatHeartRate(hr) {
return hr ? `${hr} bpm` : '-';
}
// Show error message
static showError(message) {
console.error(message);