diff --git a/client/src/components/Dawarich/dawarichSuggestionModel.ts b/client/src/components/Dawarich/dawarichSuggestionModel.ts index f987d337f..57c7c12f1 100644 --- a/client/src/components/Dawarich/dawarichSuggestionModel.ts +++ b/client/src/components/Dawarich/dawarichSuggestionModel.ts @@ -80,11 +80,11 @@ export function openStayDatesWithin( byDate: Map, span: Array ): string[] { - const bounds = span.filter((date): date is string => !!date).sort(); + const bounds = span.filter((date): date is string => !!date).sort((a, b) => a.localeCompare(b)); const first = bounds[0]; const last = bounds[bounds.length - 1]; if (!first || !last) return []; - return [...byDate.keys()].filter((date) => date >= first && date <= last).sort(); + return [...byDate.keys()].filter((date) => date >= first && date <= last).sort((a, b) => a.localeCompare(b)); } /** `HH:MM` out of an ISO timestamp, in the offset the timestamp carries. */ diff --git a/client/src/components/Journey/JourneyDayImportReview.tsx b/client/src/components/Journey/JourneyDayImportReview.tsx index dbfd1255b..1a95f6d6c 100644 --- a/client/src/components/Journey/JourneyDayImportReview.tsx +++ b/client/src/components/Journey/JourneyDayImportReview.tsx @@ -261,9 +261,9 @@ export function JourneyDayImportActions({ state, onCancel }: { state: JourneyDay <> {state.skipCount > 0 && ( - + )} diff --git a/client/src/components/Journey/JourneyDayImportStays.tsx b/client/src/components/Journey/JourneyDayImportStays.tsx index 6b0fb6de1..6bb31ae4a 100644 --- a/client/src/components/Journey/JourneyDayImportStays.tsx +++ b/client/src/components/Journey/JourneyDayImportStays.tsx @@ -17,9 +17,9 @@ type Props = { state: JourneyDayImportState; dayColor: string }; function Hinted({ label, children }: { label: string; children: ReactNode }) { return ( - + ); } diff --git a/client/src/components/Journey/JourneyRecordingReview.tsx b/client/src/components/Journey/JourneyRecordingReview.tsx index c32ee9984..77d6f5ae7 100644 --- a/client/src/components/Journey/JourneyRecordingReview.tsx +++ b/client/src/components/Journey/JourneyRecordingReview.tsx @@ -97,20 +97,20 @@ function RecordingFacts({ preview }: { preview: JourneyRecordingPreview }) { {t('journey.recording.pieces', { count: stats.segmentCount })} {stats.gapCount > 0 && ( - + )} {stats.modes.map((mode) => ( {modeLabel(mode, t)} ))} - + diff --git a/shared/src/tours/walk-hours.ts b/shared/src/tours/walk-hours.ts index 4817a2844..0107e561f 100644 --- a/shared/src/tours/walk-hours.ts +++ b/shared/src/tours/walk-hours.ts @@ -333,6 +333,8 @@ export interface WalkBoats { landings: Array<{ at: number; minutes: number | null }>; } +const NO_BOATS: Readonly = { spans: [], landings: [] }; + /** Each stop's share of the walk with the index of the route's point it is passed at. */ function walkedAlong( stops: readonly WalkStop[], @@ -381,7 +383,7 @@ export function stationArrivals( route: readonly RoutePoint[], start: number | null, walkingMinutes: number | null, - boats: Readonly = { spans: [], landings: [] }, + boats: Readonly = NO_BOATS, ): WalkArrival[] | null { if (start === null || walkingMinutes === null) return null; const walked = walkedAlong(stops, route, boats.spans);