-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix(CapacitiesTable): fix duration in tooltip #88
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -129,7 +132,7 @@ export const CapacitiesTable: React.FC<CapacitiesTableProps> = ({ | |||
<Tooltip trigger={<InfoOutlineIcon />}> | |||
<Text color="grey600" weight={600} size={12}> | |||
Duration capacity commitment in epochs. Currently, one epoch is | |||
set as 24 hours. | |||
set as {formatDistanceToNowStrict(Date.now() + epochDuration)} |
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.
I guess you can use just formatDistanceStrict
without Date.now()
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.
I added formatDuration
fn
src/utils/formatDuration.ts
Outdated
import { formatDistanceStrict } from 'date-fns' | ||
|
||
export function formatDuration(duration: number) { | ||
return formatDistanceStrict(Date.now() + duration, Date.now(), { |
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.
formatDistanceStrict(duration, 0...
will be simplier
No description provided.