do nothing if already parsed
This commit is contained in:
parent
e52c84f68c
commit
655d316ac7
@ -12,7 +12,15 @@ export default class RelativeTime extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
let time = moment.utc(this.props.value);
|
||||
|
||||
let time = false;
|
||||
|
||||
if (this.props.value instanceof moment) {
|
||||
time = this.props.value;
|
||||
} else {
|
||||
time = moment.utc(this.props.value);
|
||||
}
|
||||
|
||||
return (
|
||||
<span>{time.fromNow(this.props.suffix)}</span>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user