You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
420 B
TypeScript
13 lines
420 B
TypeScript
import { useMemo } from 'react';
|
|
import { formatFullDate } from '../util/i18n/formatting/generics';
|
|
import { CONVERSATION } from '../session/constants';
|
|
|
|
export function useFormatFullDate(timestampMs?: number) {
|
|
return useMemo(() => {
|
|
if (!timestampMs || timestampMs === CONVERSATION.LAST_JOINED_FALLBACK_TIMESTAMP) {
|
|
return '';
|
|
}
|
|
return formatFullDate(new Date(timestampMs));
|
|
}, [timestampMs]);
|
|
}
|