fix(eta): update to 12h format and ensure ETA always shows in minutes (e.g., 70 min)
This commit is contained in:
@ -23,7 +23,7 @@
|
||||
<div class="eta-loader"></div>
|
||||
</template>
|
||||
<template v-else-if="hasActiveBuses">
|
||||
<span class="eta-value">{{ etaValue }}</span>
|
||||
<span class="eta-value">{{ typeof etaValue === 'number' ? formatDurationMinutes(etaValue) : etaValue }}</span>
|
||||
<span class="eta-unit">min</span>
|
||||
</template>
|
||||
</div>
|
||||
@ -41,6 +41,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { formatDurationMinutes } from '@/utils/durationFormatter'
|
||||
|
||||
const props = defineProps<{
|
||||
isVisible: boolean
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
<div class="flex flex-col items-end text-right shrink-0 ml-4">
|
||||
<!-- ETA gigante -->
|
||||
<div v-if="bus.estado !== 'pasó'" class="text-2xl font-black text-gray-900 dark:text-white flex items-baseline gap-1" :class="{ 'text-green-600 dark:text-green-400': bus.estado === 'en_camino' }">
|
||||
<span>~{{ bus.etaMinutos }}</span>
|
||||
<span>~{{ formatDurationMinutes(bus.etaMinutos) }}</span>
|
||||
<span class="text-sm font-bold text-gray-500 dark:text-gray-400">min</span>
|
||||
</div>
|
||||
|
||||
@ -143,6 +143,7 @@
|
||||
import { ref, onMounted, onUnmounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { BusETA } from '@/composables/useETA';
|
||||
import { formatDurationMinutes } from '@/utils/durationFormatter';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user