Skip to content

Commit

Permalink
fix: Generated excel auto formating date (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik authored May 30, 2024
2 parents d3aa324 + e3370e4 commit 1c65df5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/api/src/app/shared/services/file/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ export class ExcelFileService {
const worksheet = workbook.sheet('Data');

headings.forEach((heading, index) => {
const columnName = this.getExcelColumnNameFromIndex(index + 1) + '1';
const columnName = this.getExcelColumnNameFromIndex(index + 1);
const columnHeadingCellName = columnName + '1';
if (heading.type === ColumnTypesEnum.SELECT && heading.allowMultiSelect)
worksheet.cell(columnName).value(heading.key + '#MULTI');
else worksheet.cell(columnName).value(heading.key);
worksheet.cell(columnHeadingCellName).value(heading.key + '#MULTI');
else worksheet.cell(columnHeadingCellName).value(heading.key);
if (heading.type === ColumnTypesEnum.DATE) worksheet.column(columnName).style('numberFormat', '@');
});

headings.forEach((heading, index) => {
Expand Down

0 comments on commit 1c65df5

Please sign in to comment.