Skip to content

Commit c5bdedf

Browse files
Fix date bug - always format match day date using UTC timezone (#13700)
1 parent 5c1d2a5 commit c5bdedf

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

dotcom-rendering/src/components/FootballMatchList.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type Story = StoryObj<typeof meta>;
3535
export const Default = {
3636
args: {
3737
now: '2025-03-24T15:53:12.604Z',
38-
edition: 'UK',
38+
edition: 'US',
3939
guardianBaseUrl: 'https://www.theguardian.com',
4040
initialDays,
4141
getMoreDays: () => Promise.resolve(ok(moreDays)),

dotcom-rendering/src/components/FootballMatchList.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,6 @@ const footballMatchesGridStyles = css`
7272
}
7373
`;
7474

75-
const getDateFormatter = (edition: EditionId): Intl.DateTimeFormat =>
76-
new Intl.DateTimeFormat('en-GB', {
77-
weekday: 'long',
78-
year: 'numeric',
79-
month: 'long',
80-
day: 'numeric',
81-
timeZone: getTimeZoneFromEdition(edition),
82-
});
83-
8475
const getTimeFormatter = (edition: EditionId): Intl.DateTimeFormat =>
8576
new Intl.DateTimeFormat(getLocaleFromEdition(edition), {
8677
hour: '2-digit',
@@ -392,7 +383,13 @@ export const FootballMatchList = ({
392383
getMoreDays,
393384
now,
394385
}: Props) => {
395-
const dateFormatter = getDateFormatter(edition);
386+
const dateFormatter = new Intl.DateTimeFormat('en-GB', {
387+
weekday: 'long',
388+
year: 'numeric',
389+
month: 'long',
390+
day: 'numeric',
391+
timeZone: 'UTC',
392+
});
396393
const timeFormatter = getTimeFormatter(edition);
397394

398395
const [days, setDays] = useState(initialDays);

0 commit comments

Comments
 (0)