feat(weather): block weather retrieval for non-current-day entries with translation alert

This commit is contained in:
2026-05-28 16:44:05 +02:00
parent 69476cd136
commit 387849a1c2
3 changed files with 10 additions and 0 deletions
+8
View File
@@ -412,6 +412,14 @@ export default function LogEntryEditor({ entryId, logbookId, onBack }: LogEntryE
}
const handleFetchWeather = async () => {
const localToday = new Date()
const todayStr = `${localToday.getFullYear()}-${String(localToday.getMonth() + 1).padStart(2, '0')}-${String(localToday.getDate()).padStart(2, '0')}`
if (date && date !== todayStr) {
showAlert(t('settings.weather_date_mismatch', { date, today: todayStr }))
return
}
const hasGps = evGpsLat && evGpsLng
const fallbackLocation = evLocationName.trim() || departure.trim() || destination.trim()