pughpugh / react-countdown-clock

HTML5 canvas countdown clock React component
ISC License
187 stars 83 forks source link

Minutes & Hours #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

I'd love to see you add minutes & hours countdown in addition to seconds. It'd be super useful.

pughpugh commented 8 years ago

I had a play with this today, although it needs more work;

screen shot 2015-12-20 at 13 31 32

I'd like to retain the ability of just showing seconds, but this could be controlled with another prop.

ghost commented 8 years ago

Looks awesome!

lusilva commented 8 years ago

Any updates? Would love to use this to display a countdown on my page if it had minutes and hours.

pughpugh commented 8 years ago

Thanks for the reminder. I'll try and organise some time for this.

rafmar commented 8 years ago

Great work @pughpugh :+1: Your countdown looks gorgeous and I think it definitely needs possibility of displaying minutes and hours.

YurkoZ commented 8 years ago

Any news about it?

pughpugh commented 8 years ago

No sorry, no update. I keep meaning finish it, but life is busy at the mo. I'll keep it in mind.

pughpugh commented 8 years ago

I've finally got round to starting a branch for this. Hopefully be ready soon, but feel free to check it out before hand.

I've added an optional timeFormat prop. The default is seconds, but you can also use hms. The later one will degrade from hh:mm:ss to mm:ss to ss as time runs out. The start time itself still needs to be expressed in seconds.

The font size is dynamic and will attempt to use the most amount of space appropriate for the counter size and time format. You can override this to make the sizing static via the fontSize prop.

I've added various other props as well now. See the README for details.

https://github.com/pughpugh/react-countdown-clock/tree/minutes_and_hours

pughpugh commented 8 years ago

Ok, all done. This is in 1.0.8