Modify README for Time formatting functions
WenLonG12345 opened this issue · comments
Hi, thanks for this awesome library and I love it!
However, for the time formatting functions, I notice it wont be returning 2 digits as same as the format of mm:ss
.
Here is my solution for getting 2 digits.
const timeLeft = ({ remainingTime }) => {
const minutes = (`0${Math.floor(remainingTime / 60)}`).slice(-2);
const seconds = (`0${remainingTime % 60}`).slice(-2);
return <Text>{`${minutes}:${seconds}`}</Text>;
};
Hope this helps!