We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用场景:websocket搭建实时监控面板,一些场景下当前相对时间最小值仅显示“不到一分钟内”,这粒度感觉怪怪的,希望将一分钟内精确到秒。
n-time相对时间的一分钟内精确到秒,小于1分钟后显示几秒前。
The text was updated successfully, but these errors were encountered:
参考了下date-fns的api,目前naive-ui调用了formatDistance所以返回值比较粗略。精确到秒只需要替换为formatDistanceStrict这个api就行,看下直接替换?还是另外加个Strict属性 参考自:https://date-fns.org/v2.28.0/docs/formatDistanceStrict
formatDistance
formatDistanceStrict
Strict
Sorry, something went wrong.
最常用的还是距离现在的相对时间,干脆另外加一个props属性,然后加上formatDistanceToNowStrict这个api。就可以精确显示。
formatDistanceToNowStrict
我这周看一下
closed in #2714
No branches or pull requests
This function solves the problem (这个功能解决的问题)
使用场景:websocket搭建实时监控面板,一些场景下当前相对时间最小值仅显示“不到一分钟内”,这粒度感觉怪怪的,希望将一分钟内精确到秒。
Expected API (期望的 API)
n-time相对时间的一分钟内精确到秒,小于1分钟后显示几秒前。
The text was updated successfully, but these errors were encountered: