MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / FormattedTime

Function FormattedTime

apps/site/components/Common/FormattedTime.tsx:13–25  ·  view source on GitHub ↗
({ date, format })

Source from the content-addressed store, hash-verified

11};
12
13const FormattedTime: FC<FormattedTimeProps> = ({ date, format }) => {
14 const formatter = useFormatter();
15
16 // "date" is deterministic
17
18 const dateObject = new Date(date);
19
20 return (
21 <time dateTime={dateObject.toISOString()}>
22 {formatter.dateTime(dateObject, format ?? DEFAULT_DATE_FORMAT)}
23 </time>
24 );
25};
26
27export default FormattedTime;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected