chore: fix timestamps
This commit is contained in:
@@ -22,7 +22,7 @@ export const ConflictListItem = ({
|
|||||||
note: SNNote
|
note: SNNote
|
||||||
}) => {
|
}) => {
|
||||||
const application = useApplication()
|
const application = useApplication()
|
||||||
const { words, characters, paragraphs, dateLastModified, dateCreated, format } = useNoteAttributes(application, note)
|
const { words, characters, paragraphs, serverUpdatedAt, dateCreated, format } = useNoteAttributes(application, note)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
@@ -49,7 +49,7 @@ export const ConflictListItem = ({
|
|||||||
<Icon type="restore" size="medium" />
|
<Icon type="restore" size="medium" />
|
||||||
</div>
|
</div>
|
||||||
</StyledTooltip>
|
</StyledTooltip>
|
||||||
<VisuallyHidden>Last modified</VisuallyHidden> {dateLastModified}
|
<VisuallyHidden>Last modified</VisuallyHidden> {serverUpdatedAt}
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-1.5 flex items-center gap-2">
|
<div className="mb-1.5 flex items-center gap-2">
|
||||||
<StyledTooltip gutter={8} label="Created" className="!z-modal">
|
<StyledTooltip gutter={8} label="Created" className="!z-modal">
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export const useNoteAttributes = (application: WebApplicationInterface, note: SN
|
|||||||
|
|
||||||
const readTime = useMemo(() => (typeof words === 'number' ? calculateReadTime(words) : 'N/A'), [words])
|
const readTime = useMemo(() => (typeof words === 'number' ? calculateReadTime(words) : 'N/A'), [words])
|
||||||
|
|
||||||
const dateLastModified = useMemo(() => formatDateForContextMenu(note.userModifiedDate), [note.userModifiedDate])
|
const userModifiedDate = useMemo(() => formatDateForContextMenu(note.userModifiedDate), [note.userModifiedDate])
|
||||||
|
const serverUpdatedAt = useMemo(() => formatDateForContextMenu(note.serverUpdatedAt), [note.serverUpdatedAt])
|
||||||
|
|
||||||
const dateCreated = useMemo(() => formatDateForContextMenu(note.created_at), [note.created_at])
|
const dateCreated = useMemo(() => formatDateForContextMenu(note.created_at), [note.created_at])
|
||||||
|
|
||||||
@@ -22,7 +23,8 @@ export const useNoteAttributes = (application: WebApplicationInterface, note: SN
|
|||||||
characters,
|
characters,
|
||||||
paragraphs,
|
paragraphs,
|
||||||
readTime,
|
readTime,
|
||||||
dateLastModified,
|
userModifiedDate,
|
||||||
|
serverUpdatedAt,
|
||||||
dateCreated,
|
dateCreated,
|
||||||
format,
|
format,
|
||||||
}
|
}
|
||||||
@@ -33,7 +35,7 @@ export const NoteAttributes: FunctionComponent<{
|
|||||||
note: SNNote
|
note: SNNote
|
||||||
className?: string
|
className?: string
|
||||||
}> = ({ application, note, className }) => {
|
}> = ({ application, note, className }) => {
|
||||||
const { words, characters, paragraphs, readTime, dateLastModified, dateCreated, format } = useNoteAttributes(
|
const { words, characters, paragraphs, readTime, userModifiedDate, dateCreated, format } = useNoteAttributes(
|
||||||
application,
|
application,
|
||||||
note,
|
note,
|
||||||
)
|
)
|
||||||
@@ -51,7 +53,7 @@ export const NoteAttributes: FunctionComponent<{
|
|||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
<div className="mb-1">
|
<div className="mb-1">
|
||||||
<span className="font-semibold">Last modified:</span> {dateLastModified}
|
<span className="font-semibold">Last modified:</span> {userModifiedDate}
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-1">
|
<div className="mb-1">
|
||||||
<span className="font-semibold">Created:</span> {dateCreated}
|
<span className="font-semibold">Created:</span> {dateCreated}
|
||||||
|
|||||||
Reference in New Issue
Block a user