about summary refs log tree commit diff
path: root/app/assets/javascripts/components/components/relative_timestamp.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components/components/relative_timestamp.jsx')
-rw-r--r--app/assets/javascripts/components/components/relative_timestamp.jsx15
1 files changed, 3 insertions, 12 deletions
diff --git a/app/assets/javascripts/components/components/relative_timestamp.jsx b/app/assets/javascripts/components/components/relative_timestamp.jsx
index 96f99cca8..3a5b88523 100644
--- a/app/assets/javascripts/components/components/relative_timestamp.jsx
+++ b/app/assets/javascripts/components/components/relative_timestamp.jsx
@@ -4,21 +4,12 @@ import {
   FormattedRelative
 } from 'react-intl';
 
-const RelativeTimestamp = ({ timestamp, now }) => {
-  const diff = (new Date(now)) - (new Date(timestamp));
-
-  if (diff < 0) {
-    return <FormattedMessage id='relative_time.just_now' defaultMessage='Just now' />
-  } else if (diff > (3600 * 24 * 7 * 1000)) {
-    return <FormattedDate value={timestamp} />
-  } else {
-    return <FormattedRelative value={timestamp} initialNow={now} updateInterval={0} />
-  }
+const RelativeTimestamp = ({ timestamp }) => {
+  return <FormattedRelative value={new Date(timestamp)} />;
 };
 
 RelativeTimestamp.propTypes = {
-  timestamp: React.PropTypes.string.isRequired,
-  now: React.PropTypes.any
+  timestamp: React.PropTypes.string.isRequired
 };
 
 export default RelativeTimestamp;