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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user