MCPcopy Create free account
hub / github.com/experdot/pointer / RelativeTime

Function RelativeTime

src/renderer/src/components/common/RelativeTime.tsx:15–26  ·  view source on GitHub ↗
({ timestamp, className, style })

Source from the content-addressed store, hash-verified

13 * 显示相对时间(如"2小时前"),hover时显示具体日期时间
14 */
15export const RelativeTime: React.FC<RelativeTimeProps> = ({ timestamp, className, style }) => {
16 const relativeTime = formatRelativeTime(timestamp)
17 const exactTime = formatExactDateTime(timestamp)
18
19 return (
20 <Tooltip title={exactTime} placement="top">
21 <span className={className} style={{ color: 'rgba(0, 0, 0, 0.3)', ...style }}>
22 {relativeTime}
23 </span>
24 </Tooltip>
25 )
26}
27
28export default RelativeTime

Callers

nothing calls this directly

Calls 2

formatRelativeTimeFunction · 0.90
formatExactDateTimeFunction · 0.90

Tested by

no test coverage detected