const i={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"};function f(t,r){if(!t)return"";const n=new Date(t),o=new Date,e=n.getTime()-o.getTime();if(!r?.absolute){if(e<6e4)return"刚刚";if(e<36e5)return`${Math.floor(e/6e4)}分钟前`;if(e<864e5)return`${Math.floor(e/36e5)}小时前`;if(e<6048e5)return`${Math.floor(e/864e5)}天前`}return n.toLocaleDateString("zh-CN",{...i,...r?.format})}export{f};
