Skip to content

Commit d836837

Browse files
committed
fix bulk add date/time format
1 parent 912318e commit d836837

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • packages/components/src/internal/components/editable

packages/components/src/internal/components/editable/actions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ interface CellData {
442442
}
443443

444444
async function convertRowToEditorModelData(
445-
data: Map<string, string | number | boolean>,
445+
data: string | number | boolean,
446446
col: QueryColumn,
447447
containerPath: string
448448
): Promise<CellData> {
@@ -460,7 +460,11 @@ async function convertRowToEditorModelData(
460460
message = messageAndValue.message;
461461
}
462462
} else {
463-
valueDescriptors = valueDescriptors.push({ display: data, raw: data });
463+
let display = data;
464+
if (col.isTimeOrDateTimeColumn && typeof data === 'string') {
465+
display = getDateTimeDisplayValueFromStr(data, col);
466+
}
467+
valueDescriptors = valueDescriptors.push({ display, raw: data });
464468
}
465469

466470
return { message, valueDescriptors };
@@ -479,6 +483,7 @@ async function prepareInsertRowDataFromBulkForm(
479483
const data = rowData.get(cn);
480484
const colIdx = colMin + cn;
481485
const col = insertColumns[colIdx];
486+
// convert date/time fields
482487
const { message, valueDescriptors } = await convertRowToEditorModelData(data, col, containerPath);
483488
values = values.push(valueDescriptors);
484489

0 commit comments

Comments
 (0)