Update Hero component to dynamically display years since founding; enhance TermineVorschau component with improved date and time formatting, and add Uhrzeit column in the CMS for better event management. Refactor API to handle new fields and improve data handling in CSV exports.
This commit is contained in:
@@ -536,23 +536,43 @@ const saveConfig = async () => {
|
||||
})
|
||||
|
||||
successMessage.value = 'Konfiguration erfolgreich gespeichert!'
|
||||
try { window.showSuccessModal && window.showSuccessModal('Erfolg', 'Konfiguration erfolgreich gespeichert!') } catch (e) {}
|
||||
setTimeout(() => {
|
||||
successMessage.value = ''
|
||||
}, 3000)
|
||||
} catch (error) {
|
||||
errorMessage.value = error.data?.message || 'Fehler beim Speichern der Konfiguration.'
|
||||
try { window.showErrorModal && window.showErrorModal('Fehler', errorMessage.value) } catch (e) {}
|
||||
} finally {
|
||||
isSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const addTrainingTime = () => {
|
||||
// Finde die höchste vorhandene Gruppennummer
|
||||
let maxGruppeNummer = 0
|
||||
config.value.training.zeiten.forEach(zeit => {
|
||||
if (zeit.gruppe) {
|
||||
// Prüfe, ob das gruppe-Feld eine Nummer enthält (z.B. "Gruppe 1", "1", "Gruppe 3")
|
||||
const match = zeit.gruppe.match(/(\d+)/)
|
||||
if (match) {
|
||||
const nummer = parseInt(match[1], 10)
|
||||
if (nummer > maxGruppeNummer) {
|
||||
maxGruppeNummer = nummer
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Setze die nächste Gruppennummer
|
||||
const naechsteGruppeNummer = maxGruppeNummer + 1
|
||||
|
||||
config.value.training.zeiten.push({
|
||||
id: Date.now().toString(),
|
||||
tag: 'Montag',
|
||||
von: '19:00',
|
||||
bis: '22:00',
|
||||
gruppe: ''
|
||||
gruppe: `Gruppe ${naechsteGruppeNummer}`
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user