fix: bad format of timestamp fields on CSV export, fixes 776

This commit is contained in:
Fabio Di Stasio 2024-03-23 16:33:19 +01:00
parent e19118982b
commit 65ec4c5da6
3 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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',

View File

@ -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';
@ -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;