mirror of https://github.com/Fabio286/antares.git
fix: bad format of timestamp fields on CSV export, fixes 776
This commit is contained in:
parent
e19118982b
commit
65ec4c5da6
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue