Skip to content

Commit

Permalink
fix: replaceAll in CSV export
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaferri committed Sep 24, 2024
1 parent 977c319 commit 52657fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ export const getReportCSV = async (data: ReportTimeEntry[]): Promise<string> =>
[
entry.date,
entry.email,
'"' + entry.name?.replace('/"/g', '\\"') + '"',
'"' + entry.name?.replaceAll('"', '\\"') + '"',
entry.company,
entry.crew,
'"' + entry.customer.replace('/"/g', '\\"') + '"',
'"' + entry.task.name.replace('/"/g', '\\"') + '"',
'"' + entry.project.name.replace('/"/g', '\\"') + '"',
'"' + entry.customer.replaceAll('"', '\\"') + '"',
'"' + entry.task.name.replaceAll('"', '\\"') + '"',
'"' + entry.project.name.replaceAll('"', '\\"') + '"',
entry.project.type,
entry.project.plannedHours,
entry.hours,
'"' + entry.description?.replace('/"/g', '\\"') + '"',
'"' + entry.description?.replaceAll('"', '\\"') + '"',
entry.startHour,
entry.endHour,
].join(',') + '\n';
Expand Down

0 comments on commit 52657fc

Please sign in to comment.