diff --git a/app/components/DocumentViews.js b/app/components/DocumentViews.js index 0d012ee94..8f14164dc 100644 --- a/app/components/DocumentViews.js +++ b/app/components/DocumentViews.js @@ -56,7 +56,7 @@ function DocumentViews({ document, isOpen }: Props) { : t("Currently viewing") : t("Viewed {{ timeAgo }} ago", { timeAgo: formatDistanceToNow( - view ? new Date(view.lastViewedAt) : new Date() + view ? Date.parse(view.lastViewedAt) : new Date() ), }); diff --git a/app/scenes/Document/components/DataLoader.js b/app/scenes/Document/components/DataLoader.js index 93e366730..df8fc3b5e 100644 --- a/app/scenes/Document/components/DataLoader.js +++ b/app/scenes/Document/components/DataLoader.js @@ -121,7 +121,7 @@ class DataLoader extends React.Component { return sortBy( results.map((document) => { - const time = formatDistanceToNow(document.updatedAt, { + const time = formatDistanceToNow(Date.parse(document.updatedAt), { addSuffix: true, }); return { diff --git a/app/scenes/UserProfile.js b/app/scenes/UserProfile.js index c5c74ff08..b78c7eeed 100644 --- a/app/scenes/UserProfile.js +++ b/app/scenes/UserProfile.js @@ -52,7 +52,7 @@ function UserProfile(props: Props) { ? t("Joined") : t("Invited")}{" "} {t("{{ time }} ago.", { - time: formatDistanceToNow(new Date(user.createdAt)), + time: formatDistanceToNow(Date.parse(user.createdAt)), })} {user.isAdmin && ( {t("Admin")}