New issue
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
feat: Node page #252
feat: Node page #252
Conversation
svc-shorpo
commented
Jan 19, 2024
|
e03f15e
to
f55985c
Compare
} else if (seconds < 60 * 60 * 24) { | ||
return `${Math.floor(seconds / 60 / 60)}h`; | ||
} else { | ||
return `${Math.floor(seconds / 60 / 60 / 24)}d`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would https://date-fns.org/v3.2.0/docs/formatDistance or formatDistanceToNowStrictShort
(in the utils) not work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm formatDistance could work, but don't like its verbose output format. formatDistanceToNowStrictShort worked, but I ran into weird bug with seconds being added between re-renders