fixed value error

This commit is contained in:
Matthias Hannig 2018-09-25 22:32:01 +02:00
parent 15c38dd91d
commit 082b462188

View File

@ -8,11 +8,14 @@ import React from 'react'
export default class RelativeTime extends React.Component {
render() {
let time = moment.utc(this.props.value);
if (!this.props.value) {
return null;
}
let time = moment.utc(this.props.value);
return (
<span>{time.fromNow(this.props.suffix)}</span>
)
);
}
}