Skip to content

Commit 24a1078

Browse files
committed
fix: hide weekly hours when no valid data
1 parent d59c4b8 commit 24a1078

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/components/LocationDrawerContent.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ function useOpeningHours() {
6969
return s.variant === 'open' ? `${t('hours.closesAt')} ${time}` : null
7070
})
7171
72-
const weeklyHours = computed(() => location.openingHours ? getWeeklyHours(location.openingHours) : null)
72+
const weeklyHours = computed(() => {
73+
if (!location.openingHours) return null
74+
const hours = getWeeklyHours(location.openingHours)
75+
return hours.some(h => h) ? hours : null // Only show if at least one day has hours
76+
})
7377
const rotatedHours = computed(() => weeklyHours.value && location.timezone ? rotateWeeklyHoursToToday(weeklyHours.value, location.timezone, locale.value) : null)
7478
7579
return { statusInfo, nextChangeText, rotatedHours }

0 commit comments

Comments
 (0)