mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 03:13:58 +00:00
fixed crash #908
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import _isString from 'lodash/isString';
|
import _isString from 'lodash/isString';
|
||||||
import _isArray from 'lodash/isArray';
|
import _isArray from 'lodash/isArray';
|
||||||
|
import _isDate from 'lodash/isDate';
|
||||||
import _isNumber from 'lodash/isNumber';
|
import _isNumber from 'lodash/isNumber';
|
||||||
import _isPlainObject from 'lodash/isPlainObject';
|
import _isPlainObject from 'lodash/isPlainObject';
|
||||||
import _pad from 'lodash/pad';
|
import _pad from 'lodash/pad';
|
||||||
@@ -204,16 +205,17 @@ export function stringifyCellValue(
|
|||||||
|
|
||||||
if (editorTypes?.parseDateAsDollar) {
|
if (editorTypes?.parseDateAsDollar) {
|
||||||
if (value?.$date) {
|
if (value?.$date) {
|
||||||
|
const dateString = _isDate(value.$date) ? value.$date.toISOString() : value.$date.toString();
|
||||||
switch (intent) {
|
switch (intent) {
|
||||||
case 'exportIntent':
|
case 'exportIntent':
|
||||||
case 'stringConversionIntent':
|
case 'stringConversionIntent':
|
||||||
return { value: value.$date };
|
return { value: dateString };
|
||||||
default:
|
default:
|
||||||
const m = value.$date.toString().match(dateTimeStorageRegex);
|
const m = dateString.match(dateTimeStorageRegex);
|
||||||
if (m) {
|
if (m) {
|
||||||
return { value: `${m[1]}-${m[2]}-${m[3]} ${m[4]}:${m[5]}:${m[6]}`, gridStyle: 'valueCellStyle' };
|
return { value: `${m[1]}-${m[2]}-${m[3]} ${m[4]}:${m[5]}:${m[6]}`, gridStyle: 'valueCellStyle' };
|
||||||
} else {
|
} else {
|
||||||
return { value: value.$date.toString().replace('T', ' '), gridStyle: 'valueCellStyle' };
|
return { value: dateString.replace('T', ' '), gridStyle: 'valueCellStyle' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user