ndresx / react-countdown

A customizable countdown component for React.
MIT License
746 stars 69 forks source link

ZeroPadTime doesn't show double digit #204

Closed VincensiuD closed 2 years ago

VincensiuD commented 2 years ago

Hello, just installed the library, and I used the Custom Renderer with Completed Condition however, the seconds and the minute only show one digit (like instead of 02:00 it shows 2:0) I tried to add zeroPadTime={2} in the Countdown props, but it didn't help, still single digit. cheers

VincensiuD commented 2 years ago

https://codesandbox.io/s/gracious-euclid-37klu?file=/index.js:507-522 it shows in the link above, but for some reason not in my app, I wonder if you could suggest what causes it

VincensiuD commented 2 years ago

found the solution:

const renderer = ({ formatted: { hours, minutes, seconds }, completed }) => {...} maybe you can put it in the readme? cheers :)

ndresx commented 2 years ago

https://github.com/ndresx/react-countdown#why-arent-my-values-formatted-when-using-the-custom-renderer 😄