Skip to content

Commit

Permalink
fix: column names did not parse if cell type is date
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Dec 10, 2024
1 parent bee379c commit ef7f92b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ export default class SpreadsheetUploadDialog extends ManagedObject {
return;
}
spreadsheetSheetsData = SheetHandler.sheet_to_json(workbook.Sheets[sheetName]);
columnNames = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], { header: 1 })[0] as string[];
const rawColumns = SheetHandler.sheet_to_json(workbook.Sheets[sheetName], { header: 1 })[0] as Array<{rawValue: string}>;
columnNames = rawColumns.map(column => column.rawValue || column as unknown as string);
}

if (!spreadsheetSheetsData || spreadsheetSheetsData.length === 0) {
Expand Down

0 comments on commit ef7f92b

Please sign in to comment.