talalmajali / react-native-countdown-component

React Native CountDown
MIT License
272 stars 236 forks source link

Option to display numbers without leading zero #55

Closed firatciftci closed 2 years ago

firatciftci commented 5 years ago

This pull request implements to option to display the countdown time values without a leading zero. By default, the timeToShow prop has an array of uppercase letters (['D', 'H', 'M', 'S']); with this pull request, these uppercase letters denote that a leading zero will be displayed. However, if lowercase counterparts of the same letters are used in timeToShow, the leading zero will be hidden. This is done through adjusting the sprintf() use case in the codebase such that when a lowercase character is being used, the placeholder parameter in the function is %d instead of %02d.