Enhance Excel export functionality in backend and frontend; implement Excel file generation and update download logic for correct file extension

This commit is contained in:
Torsten Schulz (local)
2025-10-18 00:03:11 +02:00
parent 6a519fc4d4
commit 6b89272335
5 changed files with 872 additions and 23 deletions

View File

@@ -153,7 +153,11 @@ async function downloadFile(format) {
const downloadUrl = window.URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = downloadUrl
a.download = `zeiterfassung_${form.value.startDate}_${form.value.endDate}.csv`
// Richtiger Dateiname je nach Format
const extension = format === 'excel' ? 'xlsx' : 'csv'
a.download = `zeiterfassung_${form.value.startDate}_${form.value.endDate}.${extension}`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)