mirror of
https://github.com/sstent/GarminSync.git
synced 2026-02-06 06:21:51 +00:00
checkpoint 1
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user