MCPcopy Create free account
hub / github.com/cppla/ServerStatus / humanAgo

Function humanAgo

web/js/app.js:42–49  ·  view source on GitHub ↗
(ts)

Source from the content-addressed store, hash-verified

40 return out + units[index];
41}
42function humanAgo(ts){
43 if(!ts) return '-';
44 const sec = Math.max(0, Math.floor(Date.now() / 1000 - Number(ts)));
45 if(sec < 60) return '几秒前';
46 const min = Math.floor(sec / 60);
47 if(min < 60) return `${min} 分钟前`;
48 return `${Math.floor(min / 60)} 小时前`;
49}
50
51function osClass(os){
52 if(!os) return '';

Callers 1

updateTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected