From 1946b1c2c1a8cd414fb312b558e4b9a09c6d18f0 Mon Sep 17 00:00:00 2001 From: Cheng Shi Date: Fri, 8 Nov 2024 10:26:34 -0500 Subject: [PATCH] fix: add dateTime attribute, and apply dateHelper to some tests --- .../file-info-data/FileDate.tsx | 8 +++++-- .../file/file-embargo/FileEmbargoDate.tsx | 8 ++++++- .../file/file-metadata/FileMetadata.tsx | 22 ++++++++++++------- .../file-embargo/FileEmbargoDate.spec.tsx | 9 ++++---- .../e2e/sections/dataset/Dataset.spec.tsx | 5 +++-- 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/sections/dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileDate.tsx b/src/sections/dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileDate.tsx index 1aa10a0a3..b0622d43e 100644 --- a/src/sections/dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileDate.tsx +++ b/src/sections/dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileDate.tsx @@ -1,13 +1,17 @@ -import { FileDate as FileDateModel } from '../../../../../../../files/domain/models/FileMetadata' import { useTranslation } from 'react-i18next' +import { FileDate as FileDateModel } from '../../../../../../../files/domain/models/FileMetadata' import { DateHelper } from '../../../../../../../shared/helpers/DateHelper' export function FileDate({ date }: { date: FileDateModel }) { const { t } = useTranslation('files') + return (
- {t(`table.date.${date.type}`)} + {t(`table.date.${date.type}`)}{' '} +
) diff --git a/src/sections/file/file-embargo/FileEmbargoDate.tsx b/src/sections/file/file-embargo/FileEmbargoDate.tsx index 6bbbcc818..65294f11e 100644 --- a/src/sections/file/file-embargo/FileEmbargoDate.tsx +++ b/src/sections/file/file-embargo/FileEmbargoDate.tsx @@ -24,7 +24,13 @@ export function FileEmbargoDate({
{t(embargoTypeOfDate(embargo.isActive, datasetPublishingStatus))}{' '} -