diff --git a/src/assets/styles/components/list_document.scss b/src/assets/styles/components/list_document.scss index 838531e..ebc6d18 100644 --- a/src/assets/styles/components/list_document.scss +++ b/src/assets/styles/components/list_document.scss @@ -179,7 +179,7 @@ .updated, .size { padding-left: 12px; - width: 120px; + max-width: 200px; } .connections { diff --git a/src/features/documents/DocumentDetail.tsx b/src/features/documents/DocumentDetail.tsx index 3a1eec1..1f7ce96 100644 --- a/src/features/documents/DocumentDetail.tsx +++ b/src/features/documents/DocumentDetail.tsx @@ -18,12 +18,14 @@ import React, { useEffect, useState } from 'react'; import { fromUnixTime, format } from 'date-fns'; import { Link, useParams, useNavigate } from 'react-router-dom'; import { useAppDispatch, useAppSelector } from 'app/hooks'; +import { selectPreferences } from 'features/users/usersSlice'; import { selectDocumentDetail, getDocumentAsync, removeDocumentByAdminAsync } from './documentsSlice'; import { Icon, Button, CodeBlock, CopyButton, Popover, Dropdown } from 'components'; export function DocumentDetail() { const navigate = useNavigate(); const { document } = useAppSelector(selectDocumentDetail); + const { use24HourClock } = useAppSelector(selectPreferences); const dispatch = useAppDispatch(); const params = useParams(); const projectName = params.projectName || ''; @@ -55,7 +57,12 @@ export function DocumentDetail() {
{document?.key} - {format(fromUnixTime(document?.updatedAt!), 'MMM d, h:mm')} + + {format( + fromUnixTime(document?.updatedAt!), + `MMM d${new Date().getFullYear() === fromUnixTime(document?.updatedAt!).getFullYear() ? '' : ', yyyy'}, ${use24HourClock ? 'HH:mm' : 'h:mm a'}`, + )} +
diff --git a/src/features/documents/DocumentList.tsx b/src/features/documents/DocumentList.tsx index 6b5d6f9..3c85f25 100644 --- a/src/features/documents/DocumentList.tsx +++ b/src/features/documents/DocumentList.tsx @@ -211,7 +211,10 @@ export function DocumentList({ isDetailOpen = false }: { isDetailOpen?: boolean {key} {!isDetailOpen && ( - {format(fromUnixTime(updatedAt), `${use24HourClock ? 'MMM d, h:mm' : 'MMM d, h:mm aa'}`)} + {format( + fromUnixTime(updatedAt), + `MMM d${new Date().getFullYear() === fromUnixTime(updatedAt).getFullYear() ? '' : ', yyyy'}, ${use24HourClock ? 'HH:mm' : 'h:mm a'}`, + )} )}