From e046eaa54499c564c64185d527857faf05664bab Mon Sep 17 00:00:00 2001 From: elraphty Date: Mon, 2 Sep 2024 11:36:38 +0100 Subject: [PATCH 1/3] changed date to en-US --- cypress/e2e/52_adminCustomDateInput.cy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/52_adminCustomDateInput.cy.ts b/cypress/e2e/52_adminCustomDateInput.cy.ts index d5a6bb1c..15d1856d 100644 --- a/cypress/e2e/52_adminCustomDateInput.cy.ts +++ b/cypress/e2e/52_adminCustomDateInput.cy.ts @@ -61,8 +61,8 @@ describe('Admin Custom Date Input', () => { const date = new Date(startYear, startMonth - 1, startDay); const date2 = new Date(endYear, endMonth - 1, endDay); - const formattedDate = date.toLocaleDateString('en-GB', { day: '2-digit', month: 'short' }); - const formattedDate2 = date2.toLocaleDateString('en-GB', { + const formattedDate = date.toLocaleDateString('en-US', { day: '2-digit', month: 'short' }); + const formattedDate2 = date2.toLocaleDateString('en-US', { day: '2-digit', month: 'short', year: 'numeric' From a8dfe7793dbb3d10891af5c4b9dcd92b86a10503 Mon Sep 17 00:00:00 2001 From: elraphty Date: Mon, 2 Sep 2024 13:08:46 +0100 Subject: [PATCH 2/3] format september month --- cypress/e2e/52_adminCustomDateInput.cy.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/52_adminCustomDateInput.cy.ts b/cypress/e2e/52_adminCustomDateInput.cy.ts index 15d1856d..9faeb396 100644 --- a/cypress/e2e/52_adminCustomDateInput.cy.ts +++ b/cypress/e2e/52_adminCustomDateInput.cy.ts @@ -68,7 +68,10 @@ describe('Admin Custom Date Input', () => { year: 'numeric' }); - cy.get('[data-testid="month"]').contains(`${formattedDate} - ${formattedDate2}`); + const finalDate = formatSeptemberMonth(formattedDate); + const finalDate2 = formatSeptemberMonth(formattedDate2); + + cy.get('[data-testid="month"]').contains(`${finalDate} - ${finalDate2}`); for (let i = 1; i <= 22; i++) { cy.contains(`Admin${i}`); @@ -77,3 +80,12 @@ describe('Admin Custom Date Input', () => { cy.logout(activeUser); }); }); + +const formatSeptemberMonth = (date: string): string => { + let newDate = ""; + if (date.includes('Sept')) { + newDate = date.replace('Sept', 'Sep'); + } + + return newDate +} \ No newline at end of file From fb0299172fc801de79be3c73354ab028a7b97497 Mon Sep 17 00:00:00 2001 From: elraphty Date: Mon, 2 Sep 2024 13:09:20 +0100 Subject: [PATCH 3/3] format september month --- cypress/e2e/52_adminCustomDateInput.cy.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/52_adminCustomDateInput.cy.ts b/cypress/e2e/52_adminCustomDateInput.cy.ts index 9faeb396..66b8ad3f 100644 --- a/cypress/e2e/52_adminCustomDateInput.cy.ts +++ b/cypress/e2e/52_adminCustomDateInput.cy.ts @@ -82,10 +82,10 @@ describe('Admin Custom Date Input', () => { }); const formatSeptemberMonth = (date: string): string => { - let newDate = ""; + let newDate = ''; if (date.includes('Sept')) { newDate = date.replace('Sept', 'Sep'); } - return newDate -} \ No newline at end of file + return newDate; +};