From 32c68bef6a4796319e5523c4b3156c5d9041ccc0 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Mon, 11 Sep 2023 10:54:50 +0200 Subject: [PATCH 1/5] Add date made to object details --- .../[id]/date-created-to-string.test.tsx | 57 +++++++++++++++++++ .../objects/[id]/date-created-to-string.ts | 24 ++++++++ .../src/app/[locale]/objects/[id]/page.tsx | 9 +++ apps/researcher/src/messages/en/messages.json | 5 +- apps/researcher/src/messages/nl/messages.json | 5 +- 5 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx create mode 100644 apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx new file mode 100644 index 000000000..cc2b25cc7 --- /dev/null +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx @@ -0,0 +1,57 @@ +import dateCreatedToString from './date-created-to-string'; +import {describe, expect, it} from '@jest/globals'; + +describe('dateCreatedToString', () => { + it('returns undefined if both startDate and endDate are undefined', async () => { + const date = await dateCreatedToString( + {startDate: undefined, endDate: undefined, id: 'timeSpan'}, + 'en' + ); + + expect(date).toBeUndefined(); + }); + + it('returns only startDate if endDate is undefined', () => { + expect( + dateCreatedToString( + {startDate: new Date('2021-01-01'), endDate: undefined, id: 'timeSpan'}, + 'en' + ) + ).toBe('Jan 1, 2021'); + }); + + it('returns only endDate if startDate is undefined', () => { + expect( + dateCreatedToString( + {startDate: undefined, endDate: new Date('2021-01-02'), id: 'timeSpan'}, + 'en' + ) + ).toBe('Jan 2, 2021'); + }); + + it('returns both startDate and endDate if both contain a date', () => { + expect( + dateCreatedToString( + { + startDate: new Date('2021-01-01'), + endDate: new Date('2021-01-02'), + id: 'timeSpan', + }, + 'en' + ) + ).toBe('Jan 1 – 2, 2021'); + }); + + it('returns one date if startDate and endDate are the same', () => { + expect( + dateCreatedToString( + { + startDate: new Date('2021-01-01'), + endDate: new Date('2021-01-01'), + id: 'timeSpan', + }, + 'en' + ) + ).toBe('Jan 1, 2021'); + }); +}); diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts new file mode 100644 index 000000000..2c0645ad4 --- /dev/null +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts @@ -0,0 +1,24 @@ +import {TimeSpan} from '@/lib/api/definitions'; + +export default function dateCreatedToString( + dateCreated: TimeSpan, + locale: string +) { + const dateTimeFormat = new Intl.DateTimeFormat(locale, { + dateStyle: 'medium', + }); + + if (!dateCreated.startDate && !dateCreated.endDate) { + return undefined; + } + + if (!dateCreated.startDate) { + return dateTimeFormat.format(dateCreated.endDate); + } + + if (!dateCreated.endDate) { + return dateTimeFormat.format(dateCreated.startDate); + } + + return dateTimeFormat.formatRange(dateCreated.startDate, dateCreated.endDate); +} diff --git a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx index 3d61a647b..b531064be 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx @@ -17,6 +17,7 @@ import { } from 'ui'; import useCurrentPublisher from './useCurrentPublisher'; import {env} from 'node:process'; +import dateCreatedToString from './date-created-to-string'; // Revalidate the page export const revalidate = 0; @@ -186,6 +187,14 @@ export default async function Details({params}: Props) { + + + {object.dateCreated && ( +
{dateCreatedToString(object.dateCreated, locale)}
+ )} +
+
+ {object.types?.map(type => ( diff --git a/apps/researcher/src/messages/en/messages.json b/apps/researcher/src/messages/en/messages.json index 7bfbb1b9c..3d31be825 100644 --- a/apps/researcher/src/messages/en/messages.json +++ b/apps/researcher/src/messages/en/messages.json @@ -62,7 +62,6 @@ "identifier": "ID: {identifier}", "metadata": "Metadata", "description": "Description", - "date": "Date", "license": "License", "materials": "Materials", "techniques": "Techniques", @@ -82,7 +81,9 @@ "inscriptionsSubTitle": "", "addedBy": "Added by from ", "currentPublisher": "Current location of object", - "noOrganizationFound": "No organization found." + "noOrganizationFound": "No organization found.", + "dateCreated": "Date Made", + "dateCreatedSubTitle": "When was the object made. Could be a exact or a date range." }, "PersonDetails": { "backButton": "Back to results", diff --git a/apps/researcher/src/messages/nl/messages.json b/apps/researcher/src/messages/nl/messages.json index 88cebdf72..d150d6db9 100644 --- a/apps/researcher/src/messages/nl/messages.json +++ b/apps/researcher/src/messages/nl/messages.json @@ -62,7 +62,6 @@ "identifier": "ID: {identifier}", "metadata": "Metadata", "description": "Beschrijving", - "date": "Datum", "license": "Licentie", "materials": "Materialen", "techniques": "Technieken", @@ -82,7 +81,9 @@ "inscriptionsSubTitle": "", "addedBy": "Toegevoegd door uit ", "currentPublisher": "Huidige locatie van object", - "noOrganizationFound": "Geen organisatie gevonden." + "noOrganizationFound": "Geen organisatie gevonden.", + "dateCreated": "Datum van creatie", + "dateCreatedSubTitle": "Wanneer is het voorwerp gemaakt? Dit kan een exacte datum of een datumbereik zijn." }, "PersonDetails": { "backButton": "Terug naar resultaten", From 1a3d931469fbcedd85dc6cd88119bad992dc1e98 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Wed, 13 Sep 2023 10:51:20 +0200 Subject: [PATCH 2/5] Minor changes to the data created formatter --- .../[id]/date-created-to-string.test.ts | 70 +++++++++++++++++++ .../[id]/date-created-to-string.test.tsx | 57 --------------- .../objects/[id]/date-created-to-string.ts | 8 +-- apps/researcher/src/messages/en/messages.json | 2 +- 4 files changed, 75 insertions(+), 62 deletions(-) create mode 100644 apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts delete mode 100644 apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts new file mode 100644 index 000000000..d85029a29 --- /dev/null +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts @@ -0,0 +1,70 @@ +import dateCreatedToString from './date-created-to-string'; +import {describe, expect, it} from '@jest/globals'; + +describe('dateCreatedToString', () => { + it('returns undefined if both startDate and endDate are undefined', () => { + const date = dateCreatedToString( + {startDate: undefined, endDate: undefined, id: 'timeSpan'}, + 'en' + ); + + expect(date).toBeUndefined(); + }); + + it('returns only startDate if endDate is undefined', () => { + const date = dateCreatedToString( + {startDate: new Date('2021-01-01'), endDate: undefined, id: 'timeSpan'}, + 'en' + ); + + expect(date).toBe('Jan 1, 2021'); + }); + + it('returns only endDate if startDate is undefined', () => { + const date = dateCreatedToString( + {startDate: undefined, endDate: new Date('2021-01-02'), id: 'timeSpan'}, + 'en' + ); + + expect(date).toBe('Jan 2, 2021'); + }); + + it('returns both startDate and endDate if both contain a date', () => { + const date = dateCreatedToString( + { + startDate: new Date('2021-01-01'), + endDate: new Date('2021-01-02'), + id: 'timeSpan', + }, + 'en' + ); + + expect(date).toBe('Jan 1 – 2, 2021'); + }); + + it('returns one date if startDate and endDate are the same', () => { + const date = dateCreatedToString( + { + startDate: new Date('2021-01-01'), + endDate: new Date('2021-01-01'), + id: 'timeSpan', + }, + 'en' + ); + + expect(date).toBe('Jan 1, 2021'); + }); + + it('returns only dates and not times', () => { + const date = dateCreatedToString( + { + startDate: new Date('2021-01-01T12:00:00'), + endDate: new Date('2021-01-02T13:00:00'), + id: 'timeSpan', + }, + 'en' + ); + + expect(date).toBe('Jan 1 – 2, 2021'); + }); +}); diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx deleted file mode 100644 index cc2b25cc7..000000000 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import dateCreatedToString from './date-created-to-string'; -import {describe, expect, it} from '@jest/globals'; - -describe('dateCreatedToString', () => { - it('returns undefined if both startDate and endDate are undefined', async () => { - const date = await dateCreatedToString( - {startDate: undefined, endDate: undefined, id: 'timeSpan'}, - 'en' - ); - - expect(date).toBeUndefined(); - }); - - it('returns only startDate if endDate is undefined', () => { - expect( - dateCreatedToString( - {startDate: new Date('2021-01-01'), endDate: undefined, id: 'timeSpan'}, - 'en' - ) - ).toBe('Jan 1, 2021'); - }); - - it('returns only endDate if startDate is undefined', () => { - expect( - dateCreatedToString( - {startDate: undefined, endDate: new Date('2021-01-02'), id: 'timeSpan'}, - 'en' - ) - ).toBe('Jan 2, 2021'); - }); - - it('returns both startDate and endDate if both contain a date', () => { - expect( - dateCreatedToString( - { - startDate: new Date('2021-01-01'), - endDate: new Date('2021-01-02'), - id: 'timeSpan', - }, - 'en' - ) - ).toBe('Jan 1 – 2, 2021'); - }); - - it('returns one date if startDate and endDate are the same', () => { - expect( - dateCreatedToString( - { - startDate: new Date('2021-01-01'), - endDate: new Date('2021-01-01'), - id: 'timeSpan', - }, - 'en' - ) - ).toBe('Jan 1, 2021'); - }); -}); diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts index 2c0645ad4..285d367db 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts @@ -4,14 +4,14 @@ export default function dateCreatedToString( dateCreated: TimeSpan, locale: string ) { - const dateTimeFormat = new Intl.DateTimeFormat(locale, { - dateStyle: 'medium', - }); - if (!dateCreated.startDate && !dateCreated.endDate) { return undefined; } + const dateTimeFormat = new Intl.DateTimeFormat(locale, { + dateStyle: 'medium', + }); + if (!dateCreated.startDate) { return dateTimeFormat.format(dateCreated.endDate); } diff --git a/apps/researcher/src/messages/en/messages.json b/apps/researcher/src/messages/en/messages.json index 3d31be825..2467513dc 100644 --- a/apps/researcher/src/messages/en/messages.json +++ b/apps/researcher/src/messages/en/messages.json @@ -83,7 +83,7 @@ "currentPublisher": "Current location of object", "noOrganizationFound": "No organization found.", "dateCreated": "Date Made", - "dateCreatedSubTitle": "When was the object made. Could be a exact or a date range." + "dateCreatedSubTitle": "When was the object made? Could be an exact date or a range." }, "PersonDetails": { "backButton": "Back to results", From d94d013ee327a25f872d7552f44d52ba02058b69 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Fri, 15 Sep 2023 09:29:18 +0200 Subject: [PATCH 3/5] Rename function and variables --- ...test.ts => date-created-formatter.test.ts} | 28 +++++++++---------- ...to-string.ts => date-created-formatter.ts} | 5 +--- .../src/app/[locale]/objects/[id]/page.tsx | 4 +-- 3 files changed, 17 insertions(+), 20 deletions(-) rename apps/researcher/src/app/[locale]/objects/[id]/{date-created-to-string.test.ts => date-created-formatter.test.ts} (64%) rename apps/researcher/src/app/[locale]/objects/[id]/{date-created-to-string.ts => date-created-formatter.ts} (84%) diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts b/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts similarity index 64% rename from apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts rename to apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts index d85029a29..edb90b4fe 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.test.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts @@ -1,36 +1,36 @@ -import dateCreatedToString from './date-created-to-string'; +import {dateCreatedFormatter} from './date-created-formatter'; import {describe, expect, it} from '@jest/globals'; -describe('dateCreatedToString', () => { +describe('dateCreatedFormatter', () => { it('returns undefined if both startDate and endDate are undefined', () => { - const date = dateCreatedToString( + const formattedDate = dateCreatedFormatter( {startDate: undefined, endDate: undefined, id: 'timeSpan'}, 'en' ); - expect(date).toBeUndefined(); + expect(formattedDate).toBeUndefined(); }); it('returns only startDate if endDate is undefined', () => { - const date = dateCreatedToString( + const formattedDate = dateCreatedFormatter( {startDate: new Date('2021-01-01'), endDate: undefined, id: 'timeSpan'}, 'en' ); - expect(date).toBe('Jan 1, 2021'); + expect(formattedDate).toBe('Jan 1, 2021'); }); it('returns only endDate if startDate is undefined', () => { - const date = dateCreatedToString( + const formattedDate = dateCreatedFormatter( {startDate: undefined, endDate: new Date('2021-01-02'), id: 'timeSpan'}, 'en' ); - expect(date).toBe('Jan 2, 2021'); + expect(formattedDate).toBe('Jan 2, 2021'); }); it('returns both startDate and endDate if both contain a date', () => { - const date = dateCreatedToString( + const formattedDate = dateCreatedFormatter( { startDate: new Date('2021-01-01'), endDate: new Date('2021-01-02'), @@ -39,11 +39,11 @@ describe('dateCreatedToString', () => { 'en' ); - expect(date).toBe('Jan 1 – 2, 2021'); + expect(formattedDate).toBe('Jan 1 – 2, 2021'); }); it('returns one date if startDate and endDate are the same', () => { - const date = dateCreatedToString( + const formattedDate = dateCreatedFormatter( { startDate: new Date('2021-01-01'), endDate: new Date('2021-01-01'), @@ -52,11 +52,11 @@ describe('dateCreatedToString', () => { 'en' ); - expect(date).toBe('Jan 1, 2021'); + expect(formattedDate).toBe('Jan 1, 2021'); }); it('returns only dates and not times', () => { - const date = dateCreatedToString( + const formattedDate = dateCreatedFormatter( { startDate: new Date('2021-01-01T12:00:00'), endDate: new Date('2021-01-02T13:00:00'), @@ -65,6 +65,6 @@ describe('dateCreatedToString', () => { 'en' ); - expect(date).toBe('Jan 1 – 2, 2021'); + expect(formattedDate).toBe('Jan 1 – 2, 2021'); }); }); diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts b/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.ts similarity index 84% rename from apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts rename to apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.ts index 285d367db..bf2c3743a 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-to-string.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.ts @@ -1,9 +1,6 @@ import {TimeSpan} from '@/lib/api/definitions'; -export default function dateCreatedToString( - dateCreated: TimeSpan, - locale: string -) { +export function dateCreatedFormatter(dateCreated: TimeSpan, locale: string) { if (!dateCreated.startDate && !dateCreated.endDate) { return undefined; } diff --git a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx index b531064be..274e229d1 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx @@ -17,7 +17,7 @@ import { } from 'ui'; import useCurrentPublisher from './useCurrentPublisher'; import {env} from 'node:process'; -import dateCreatedToString from './date-created-to-string'; +import {dateCreatedFormatter} from './date-created-formatter'; // Revalidate the page export const revalidate = 0; @@ -190,7 +190,7 @@ export default async function Details({params}: Props) { {object.dateCreated && ( -
{dateCreatedToString(object.dateCreated, locale)}
+
{dateCreatedFormatter(object.dateCreated, locale)}
)}
From 4b2ebe37994e6899b4ced84ab6a8ea1a01d06702 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Fri, 15 Sep 2023 09:29:41 +0200 Subject: [PATCH 4/5] Add test 'returns dates in the correct locale' --- .../objects/[id]/date-created-formatter.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts b/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts index edb90b4fe..9489a726d 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts @@ -67,4 +67,17 @@ describe('dateCreatedFormatter', () => { expect(formattedDate).toBe('Jan 1 – 2, 2021'); }); + + it('returns dates in the correct locale', () => { + const formattedDate = dateCreatedFormatter( + { + startDate: new Date('2021-05-01'), + endDate: new Date('2021-10-02'), + id: 'timeSpan', + }, + 'nl' + ); + + expect(formattedDate).toBe('1 mei – 2 okt 2021'); + }); }); From 06c907681ea92d109dc3ac09fe8b91782f763620 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Fri, 15 Sep 2023 09:43:44 +0200 Subject: [PATCH 5/5] Rename 'dateCreatedFormatter' to 'formatDateCreated' --- ...ter.test.ts => format-date-created.test.ts} | 18 +++++++++--------- ...ted-formatter.ts => format-date-created.ts} | 2 +- .../src/app/[locale]/objects/[id]/page.tsx | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) rename apps/researcher/src/app/[locale]/objects/[id]/{date-created-formatter.test.ts => format-date-created.test.ts} (80%) rename apps/researcher/src/app/[locale]/objects/[id]/{date-created-formatter.ts => format-date-created.ts} (86%) diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts b/apps/researcher/src/app/[locale]/objects/[id]/format-date-created.test.ts similarity index 80% rename from apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts rename to apps/researcher/src/app/[locale]/objects/[id]/format-date-created.test.ts index 9489a726d..1bb84c76f 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.test.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/format-date-created.test.ts @@ -1,9 +1,9 @@ -import {dateCreatedFormatter} from './date-created-formatter'; +import {formatDateCreated} from './format-date-created'; import {describe, expect, it} from '@jest/globals'; -describe('dateCreatedFormatter', () => { +describe('formatDateCreated', () => { it('returns undefined if both startDate and endDate are undefined', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( {startDate: undefined, endDate: undefined, id: 'timeSpan'}, 'en' ); @@ -12,7 +12,7 @@ describe('dateCreatedFormatter', () => { }); it('returns only startDate if endDate is undefined', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( {startDate: new Date('2021-01-01'), endDate: undefined, id: 'timeSpan'}, 'en' ); @@ -21,7 +21,7 @@ describe('dateCreatedFormatter', () => { }); it('returns only endDate if startDate is undefined', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( {startDate: undefined, endDate: new Date('2021-01-02'), id: 'timeSpan'}, 'en' ); @@ -30,7 +30,7 @@ describe('dateCreatedFormatter', () => { }); it('returns both startDate and endDate if both contain a date', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( { startDate: new Date('2021-01-01'), endDate: new Date('2021-01-02'), @@ -43,7 +43,7 @@ describe('dateCreatedFormatter', () => { }); it('returns one date if startDate and endDate are the same', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( { startDate: new Date('2021-01-01'), endDate: new Date('2021-01-01'), @@ -56,7 +56,7 @@ describe('dateCreatedFormatter', () => { }); it('returns only dates and not times', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( { startDate: new Date('2021-01-01T12:00:00'), endDate: new Date('2021-01-02T13:00:00'), @@ -69,7 +69,7 @@ describe('dateCreatedFormatter', () => { }); it('returns dates in the correct locale', () => { - const formattedDate = dateCreatedFormatter( + const formattedDate = formatDateCreated( { startDate: new Date('2021-05-01'), endDate: new Date('2021-10-02'), diff --git a/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.ts b/apps/researcher/src/app/[locale]/objects/[id]/format-date-created.ts similarity index 86% rename from apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.ts rename to apps/researcher/src/app/[locale]/objects/[id]/format-date-created.ts index bf2c3743a..1aeafd119 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/date-created-formatter.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/format-date-created.ts @@ -1,6 +1,6 @@ import {TimeSpan} from '@/lib/api/definitions'; -export function dateCreatedFormatter(dateCreated: TimeSpan, locale: string) { +export function formatDateCreated(dateCreated: TimeSpan, locale: string) { if (!dateCreated.startDate && !dateCreated.endDate) { return undefined; } diff --git a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx index 274e229d1..a45ae25e5 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx @@ -17,7 +17,7 @@ import { } from 'ui'; import useCurrentPublisher from './useCurrentPublisher'; import {env} from 'node:process'; -import {dateCreatedFormatter} from './date-created-formatter'; +import {formatDateCreated} from './format-date-created'; // Revalidate the page export const revalidate = 0; @@ -190,7 +190,7 @@ export default async function Details({params}: Props) { {object.dateCreated && ( -
{dateCreatedFormatter(object.dateCreated, locale)}
+
{formatDateCreated(object.dateCreated, locale)}
)}