From 380704f66be55ae38d3788772b76639de0b7d0f8 Mon Sep 17 00:00:00 2001 From: Tony Barnes Date: Wed, 26 Jun 2024 16:16:46 +0100 Subject: [PATCH] fix(EMS-3494): no pdf - application submission - xlsx date format (#2644) --- src/api/.keystone/config.js | 2 +- .../map-financial-year-end-date/index.test.ts | 3 ++- .../map-exporter-business/map-financial-year-end-date/index.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/.keystone/config.js b/src/api/.keystone/config.js index ded819a0ed..394291e10e 100644 --- a/src/api/.keystone/config.js +++ b/src/api/.keystone/config.js @@ -7211,7 +7211,7 @@ var { var { FIELDS: FIELDS18 } = XLSX; var mapFinancialYearEndDate = (company) => { if (company[FINANCIAL_YEAR_END_DATE2]) { - return format_date_default(company[FINANCIAL_YEAR_END_DATE2], "d MMMM"); + return format_date_default(company[FINANCIAL_YEAR_END_DATE2], DATE_FORMAT.XLSX); } return FIELDS18.NO_FINANCIAL_YEAR_END_DATE; }; diff --git a/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.test.ts b/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.test.ts index b2b87b922f..e1105f8cbd 100644 --- a/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.test.ts +++ b/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.test.ts @@ -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'; @@ -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); }); diff --git a/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.ts b/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.ts index 04dec55f53..e9cd62790c 100644 --- a/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.ts +++ b/src/api/generate-xlsx/map-application-to-XLSX/map-exporter-business/map-financial-year-end-date/index.ts @@ -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'; @@ -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;