intl.now() --> Date.now()

This commit is contained in:
Alex Gleason 2020-06-04 19:30:24 -05:00
parent 6e1db9a013
commit 52621e8db8
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -122,7 +122,7 @@ class RelativeTimestamp extends React.Component {
}; };
state = { state = {
now: this.props.intl.now(), now: Date.now(),
}; };
static defaultProps = { static defaultProps = {
@ -139,7 +139,7 @@ class RelativeTimestamp extends React.Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (this.props.timestamp !== nextProps.timestamp) { if (this.props.timestamp !== nextProps.timestamp) {
this.setState({ now: this.props.intl.now() }); this.setState({ now: Date.now() });
} }
} }
@ -166,7 +166,7 @@ class RelativeTimestamp extends React.Component {
const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder); const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder);
this._timer = setTimeout(() => { this._timer = setTimeout(() => {
this.setState({ now: this.props.intl.now() }); this.setState({ now: Date.now() });
}, delay); }, delay);
} }