CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/course/common/big-time.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { ISO_to_Date } from "@cocalc/util/misc";
7
import { TimeAgo } from "@cocalc/frontend/components";
8
9
interface BigTimeProps {
10
date: string | number | Date;
11
}
12
13
export function BigTime({ date }: BigTimeProps) {
14
if (date == null) {
15
return null;
16
}
17
if (typeof date === "string") {
18
date = ISO_to_Date(date);
19
}
20
return <TimeAgo date={date} />;
21
}
22
23