Skip to content

Commit

Permalink
Merge pull request #75 from OneBusAway/fix/arrivalTimeDate
Browse files Browse the repository at this point in the history
fix: time formatting issue
  • Loading branch information
aaronbrethorst authored Oct 29, 2024
2 parents 10b5c6d + 7296143 commit 0943078
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/oba/TripDetailsPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
function formatTime(seconds) {
if (!seconds) return '';
const date = new Date(seconds * 1000);
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const utcDate = new Date(date.toUTCString().slice(0, -4));
return utcDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
}
function calculateBusPosition() {
Expand Down

0 comments on commit 0943078

Please sign in to comment.