기록 시간 슬라이더 표시 정리

This commit is contained in:
seo
2026-07-03 10:58:54 +09:00
parent 37fa87921c
commit d518b4179c
2 changed files with 13 additions and 5 deletions
+12 -4
View File
@@ -1492,6 +1492,17 @@ function formatDateTime(value) {
});
}
function formatTimelineTime(value) {
const ts = toTimestamp(value);
if (!ts) return '-';
return new Date(ts).toLocaleString(langCode === 'ko' ? 'ko-KR' : 'en-US', {
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
});
}
function speedColor(kmh) {
return speedBucket(kmh).color;
}
@@ -2001,10 +2012,7 @@ function moveSelectedHistoryPoint(index, pan = false, syncSlider = true) {
const value = document.getElementById('historyTimelineValue');
if (value) {
const prev = points[Math.max(0, safeIndex - 1)];
const seconds = safeIndex > 0 ? Math.max(1, (toTimestamp(point.time) - toTimestamp(prev.time)) / 1000) : 0;
const kmh = safeIndex > 0 ? distanceMeters(prev, point) / seconds * 3.6 : 0;
value.textContent = `${formatDateTime(point.time)} · ${speedLabel(kmh)} ${formatSpeed(kmh)}`;
value.textContent = formatTimelineTime(point.time);
}
if (syncSlider) {
const slider = document.getElementById('historyTimelineSlider');