diff --git a/web/components/relative-timestamp.tsx b/web/components/relative-timestamp.tsx index d4b1c189..eb03e324 100644 --- a/web/components/relative-timestamp.tsx +++ b/web/components/relative-timestamp.tsx @@ -1,15 +1,22 @@ import { DateTimeTooltip } from './datetime-tooltip' -import React from 'react' +import React, { useEffect, useState } from 'react' import { fromNow } from 'web/lib/util/time' export function RelativeTimestamp(props: { time: number }) { const { time } = props + const [isClient, setIsClient] = useState(false) + + useEffect(() => { + // Only render on client to prevent difference from server. + setIsClient(true) + }, []) + return ( - {fromNow(time)} + {isClient ? fromNow(time) : ''} ) }