Skip to content

Commit

Permalink
Merge branch 'SebastianHanfland:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SternfahrtMuc authored Apr 5, 2024
2 parents 8123065 + f773df0 commit 13cc920
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions website/src/common/map/addTrackToMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Point, Track } from 'gpxparser';
import L, { LayerGroup } from 'leaflet';
import { getColorFromUuid } from '../../utils/colorUtil.ts';
import { breakIcon, endIcon, startIcon } from '../MapIcons.ts';
import { getTimeDifferenceInSeconds } from '../../utils/dateUtil.ts';
import { formatTimeOnly, getTimeDifferenceInSeconds } from '../../utils/dateUtil.ts';
import { CalculatedTrack, GpxSegment, isZipTrack, ZipTrack } from '../types.ts';
import { getGpx } from './gpxCache.ts';

Expand Down Expand Up @@ -63,7 +63,9 @@ function addStartAndBreakMarker(
if (timeDifferenceInSeconds > 4 * 60) {
const endMarker = L.marker(toLatLng(point), {
icon: breakIcon,
title: `${gpxSegment.filename} - ${(timeDifferenceInSeconds / 60).toFixed(0)} min Pause`,
title: `${gpxSegment.filename} - ${(timeDifferenceInSeconds / 60).toFixed(
0
)} min Pause\n um ${formatTimeOnly(lastTimeStamp, true)}`,
});
endMarker.addTo(routeLayer);
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/utils/dateUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export function formatDate(dateString: string): string {
return date.format(new Date(dateString), DATE_FORMAT);
}

export function formatTimeOnly(dateString: string): string {
const TIME_FORMAT = 'HH:mm:ss';
export function formatTimeOnly(dateString: string, noSecond = false): string {
const TIME_FORMAT = noSecond ? 'HH:mm' : 'HH:mm:ss';
return date.format(new Date(dateString), TIME_FORMAT);
}

Expand Down

0 comments on commit 13cc920

Please sign in to comment.