Getting the progress while counting down #216
-
|
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! |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
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?