Misc fixes from qa pass (#5650)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import * as React from "react";
|
||||
import { dateToRelative } from "@shared/utils/date";
|
||||
import lazyWithRetry from "~/utils/lazyWithRetry";
|
||||
|
||||
const LocaleTime = lazyWithRetry(() => import("~/components/LocaleTime"));
|
||||
@@ -9,17 +9,11 @@ type Props = React.ComponentProps<typeof LocaleTime> & {
|
||||
};
|
||||
|
||||
function Time({ onClick, ...props }: Props) {
|
||||
let content = formatDistanceToNow(Date.parse(props.dateTime), {
|
||||
const content = dateToRelative(Date.parse(props.dateTime), {
|
||||
addSuffix: props.addSuffix,
|
||||
shorten: props.shorten,
|
||||
});
|
||||
|
||||
if (props.shorten) {
|
||||
content = content
|
||||
.replace("about", "")
|
||||
.replace("less than a minute ago", "just now")
|
||||
.replace("minute", "min");
|
||||
}
|
||||
|
||||
return (
|
||||
<span onClick={onClick}>
|
||||
<React.Suspense
|
||||
|
||||
Reference in New Issue
Block a user