Commit 6ac13c4 Replace react-timeago with FormattedRelative from react-intl

4 files Authored and Committed by abompard 6 months ago
Replace react-timeago with FormattedRelative from react-intl

    
 1 @@ -1,5 +1,5 @@
 2   import React from 'react';
 3 - import TimeAgo from 'react-timeago';
 4 + import { FormattedRelative } from 'react-intl';
 5   //import './cobweb.css';
 6   import ArchivedIcon from './archived.png';
 7   import CobWebIcon from './cobweb.png';
 8 @@ -19,7 +19,7 @@
 9           msg = (
10               <span>
11                   <span>Cobweb alert!  This hub was last active </span>
12 -                 <TimeAgo date={this.props.mtime} />
13 +                 <FormattedRelative value={new Date(this.props.hub.mtime)} />
14               </span>
15               );
16       } else {
 1 @@ -1,5 +1,5 @@
 2   import React from 'react';
 3 - import TimeAgo from 'react-timeago';
 4 + import { FormattedRelative } from 'react-intl';
 5   
 6   
 7   export default class Markup extends React.Component {
 8 @@ -32,7 +32,7 @@
 9           <span dangerouslySetInnerHTML={this.createMarkup(this.props.item)}></span>
10           {timestamp &&
11             <small className="text-muted ml-3">
12 -             <TimeAgo date={timestamp * 1000} />
13 +             <FormattedRelative value={new Date(timestamp * 1000)} />
14             </small>
15           }
16           {submessages.length !== 0 &&
 1 @@ -11282,11 +11282,6 @@
 2           "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
 3         }
 4       },
 5 -     "react-timeago": {
 6 -       "version": "3.4.3",
 7 -       "resolved": "https://registry.npmjs.org/react-timeago/-/react-timeago-3.4.3.tgz",
 8 -       "integrity": "sha1-65Bh7vsETkorCc6MmdNGRbLb+iU="
 9 -     },
10       "react-universal-component": {
11         "version": "2.8.2",
12         "resolved": "https://registry.npmjs.org/react-universal-component/-/react-universal-component-2.8.2.tgz",
1 @@ -20,7 +20,6 @@
2       "react-redux": "^5.0.6",
3       "react-select-2": "^2.0.11",
4       "react-sortable-hoc": "^0.6.7",
5 -     "react-timeago": "^3.4.3",
6       "react-universal-component": "^2.5.5",
7       "reconnecting-eventsource": "^1.0.1",
8       "redux": "^3.7.2",