mirror of
https://git-qiuchenly.yltfspace.com/QiuChenly/corepatch
synced 2025-11-25 05:40:27 +08:00
4 lines
751 B
JavaScript
4 lines
751 B
JavaScript
function t(t){const n=new Date(t),e=(new Date).getTime()-n.getTime(),r=Math.floor(e/6e4),o=Math.floor(e/36e5),a=Math.floor(e/864e5)
|
|
return r<1?"刚刚":r<60?`${r}分钟前`:o<24?`${o}小时前`:a<7?`${a}天前`:n.toLocaleDateString("zh-CN")}function n(t){return t.author.id}function e(t){return t.author.nickName||t.author.username||""}function r(t){return t.author.username}function o(t){return t.filter(t=>"image"===t.type)}function a(t){return t.filter(t=>"image"!==t.type)}function i(t){var n,e
|
|
return"string"==typeof t?t:t&&"object"==typeof t?(null==(n=t._id)?void 0:n.toString())||(null==(e=t.id)?void 0:e.toString())||t.toString():String(t)}function u(t){return o(t).map(t=>i(t))}export{e as a,r as b,o as c,a as d,u as e,t as f,n as g,i as h}
|