Skip to content

Commit

Permalink
fix: bad format of timestamp fields on CSV export, fixes 776
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Mar 23, 2024
1 parent e191189 commit 65ec4c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ app.on('ready', async () => {
if (isWindows)
mainWindow.show();

// if (isDevelopment)
// mainWindow.webContents.openDevTools();
if (isDevelopment && !isWindows)// Because on Windows you can open devtools from title-bar
mainWindow.webContents.openDevTools();

process.on('uncaughtException', error => {
mainWindow.webContents.send('unhandled-exception', error);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/i18n/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export const enUS = {
wrapLongLines: 'Wrap long lines',
markdownSupported: 'Markdown supported',
plantATree: 'Plant a Tree',
dataTabPageSize: 'DATA tab page size',
dataTabPageSize: 'Results per page',
noOpenTabs: 'There are no open tabs, navigate on the left bar or:',
restorePreviousSession: 'Restore previous session',
closeTab: 'Close tab',
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/libs/exportRows.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ClientCode } from 'common/interfaces/antares';
import { jsonToSqlInsert } from 'common/libs/sqlUtils';
import * as json2php from 'json2php';
import * as moment from 'moment';

export const exportRows = (args: {
type: 'csv' | 'json'| 'sql' | 'php';
Expand Down Expand Up @@ -41,6 +42,7 @@ export const exportRows = (args: {
for (const row of args.content) {
csv.push(Object.values(row).map(col => {
if (typeof col === 'string') return `${sd}${col}${sd}`;
if (col instanceof Date) return `${sd}${moment(col).format('YYYY-MM-DD HH:mm:ss')}${sd}`;
if (col instanceof Buffer) return col.toString('base64');
if (col instanceof Uint8Array) return Buffer.from(col).toString('base64');
return col;
Expand Down

0 comments on commit 65ec4c5

Please sign in to comment.