Repository navigation
Getting the progress while counting down #216
Answered
by
ndresx
PlacidSerene
asked this question in
Q&A
|
Is there a way to get the percentage complete for the countdown. I'm trying to make a circular progress bar to display the progress when counting down. Thank you! |
Answered by
ndresx
Oct 11, 2022
Replies: 1 comment 3 replies
|
The only way I could think of right now is to use this object returned in the renderer or other callback functions: https://github.com/ndresx/react-countdown#renderer. There's a |
3 replies
Answer selected by
PlacidSerene
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only way I could think of right now is to use this object returned in the renderer or other callback functions: https://github.com/ndresx/react-countdown#renderer. There's a
totalvalue that basically represents the time left in milliseconds. Since you know the initial time, you could use one of the callbacks or https://github.com/ndresx/react-countdown#calctimedeltadate-options to calculate the initialtotaltime left, and then do the rest of the math by calculating the percentage between this initialtotaland the currenttotal. Does this help?