Skip to content

Commit 22acad5

Browse files
committed
iso-like date when printing out to csv
1 parent 54fad55 commit 22acad5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/renderers/csv.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import { stringify } from 'csv-stringify/sync';
55

66
export const renderCSV: RenderItemsFn = (items, show_tags) => {
77
process.stdout.write(stringify(
8-
items.map(({ tags }) => tags),
8+
items.map(({ tags }) => {
9+
if (tags.date) {
10+
tags.date = `${tags.date.slice(0, 4)}-${tags.date.slice(4, 6)}-${tags.date.slice(6, 8)}`;
11+
}
12+
return tags;
13+
}),
914
{ columns: show_tags, header: true },
1015
));
1116
};

0 commit comments

Comments
 (0)