react-moment
react-moment copied to clipboard
How do I set format for durationFromNow?
I'm trying to set a format for the duration time, but I am unable to do so. The default format seems to be mm:ss, but I'd like to change that to (HH:mm:ss).
This is what I tried to do:
<Moment element={Text} date={this.props.start} format="HH:mm:ss" durationFromNow unix />
This only return the this.props.start (unix time) formatted as HH:mm:ss and seems to forget about the durationFromNow.
I also tried
<Moment element={Text} date={this.props.start} format="mm:ss" durationFromNow unix />
This returns 1,798:00
I also wonder how
const now = new Date()
...
<Moment date={now} durationFromNow interval={1000} />
This returns x milliseconds before the first second has passed =/
@Annihil me too. I would assume that +/- 0.5 seconds are just 0 seconds. And all above is one second and so on.