Skip to content

Commit 7c0761d

Browse files
authored
feat: Add 'app' and 'title' fields to CSV export in Reports (#552)
Closes ActivityWatch/activitywatch#1010
1 parent abec92a commit 7c0761d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/views/Report.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ export default {
175175
176176
export_csv() {
177177
const data = this.events.map(e => {
178-
return [e.timestamp, e.duration, e.data['$category']];
178+
return [e.timestamp, e.duration, e.data['$category'], e.data['app'], e.data['title']];
179+
});
180+
const csv = Papa.unparse(data, {
181+
columns: ['timestamp', 'duration', 'category', 'app', 'title'],
179182
});
180-
const csv = Papa.unparse(data, { columns: ['timestamp', 'duration', 'category'] });
181183
const blob = new Blob([csv], { type: 'text/csv' });
182184
const url = URL.createObjectURL(blob);
183185
const link = document.createElement('a');

0 commit comments

Comments
 (0)