Skip to content

Commit

Permalink
fix(EMS-3494): no pdf - application submission - xlsx date format (#2644
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ttbarnes authored Jun 26, 2024
1 parent 6123d86 commit 380704f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/.keystone/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import mapFinancialYearEndDate from '.';
import { DATE_FORMAT } from '../../../../constants';
import FIELD_IDS from '../../../../constants/field-ids/insurance/business';
import { XLSX } from '../../../../content-strings';
import formatDate from '../../../../helpers/format-date';
Expand All @@ -22,7 +23,7 @@ describe('api/generate-xlsx/map-application-to-xlsx/map-exporter-business/map-fi

const result = mapFinancialYearEndDate(mockCompany);

const expected = formatDate(mockCompany[FINANCIAL_YEAR_END_DATE], 'd MMMM');
const expected = formatDate(mockCompany[FINANCIAL_YEAR_END_DATE], DATE_FORMAT.XLSX);

expect(result).toEqual(expected);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DATE_FORMAT } from '../../../../constants';
import FIELD_IDS from '../../../../constants/field-ids/insurance/business';
import { XLSX } from '../../../../content-strings';
import formatDate from '../../../../helpers/format-date';
Expand All @@ -18,7 +19,7 @@ const { FIELDS } = XLSX;
*/
const mapFinancialYearEndDate = (company: ApplicationCompany) => {
if (company[FINANCIAL_YEAR_END_DATE]) {
return formatDate(company[FINANCIAL_YEAR_END_DATE], 'd MMMM');
return formatDate(company[FINANCIAL_YEAR_END_DATE], DATE_FORMAT.XLSX);
}

return FIELDS.NO_FINANCIAL_YEAR_END_DATE;
Expand Down

0 comments on commit 380704f

Please sign in to comment.