diff --git a/client/coral-admin/src/routes/Moderation/components/CommentTimeAgo.js b/client/coral-admin/src/routes/Moderation/components/CommentTimeAgo.js
deleted file mode 100644
index 280ad4479..000000000
--- a/client/coral-admin/src/routes/Moderation/components/CommentTimeAgo.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { timeago } from 'coral-framework/services/i18n';
-
-class CommentTimeAgo extends React.Component {
- constructor(props) {
- super(props);
- this.state = { timeago: true };
- }
- toggleDate() {
- this.setState({ timeago: !this.state.timeago });
- }
- render() {
- return (
-
- {this.state.timeago && timeago(this.props.date)}
- {!this.state.timeago && new Date(this.props.date).toLocaleString()}
-
- );
- }
-}
-
-CommentTimeAgo.propTypes = {
- date: PropTypes.string,
-};
-
-export default CommentTimeAgo;
diff --git a/client/coral-framework/components/CommentTimestamp.js b/client/coral-framework/components/CommentTimestamp.js
index 8e4466f7b..9e8f2aedb 100644
--- a/client/coral-framework/components/CommentTimestamp.js
+++ b/client/coral-framework/components/CommentTimestamp.js
@@ -1,13 +1,14 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { timeago } from 'coral-framework/services/i18n';
import cn from 'classnames';
import styles from './CommentTimestamp.css';
+import TimeAgo from 'coral-framework/components/TimeAgo';
const CommentTimestamp = ({ className, created_at }) => (
-
- {timeago(created_at)}
-
+
);
CommentTimestamp.propTypes = {
diff --git a/client/coral-framework/components/TimeAgo.js b/client/coral-framework/components/TimeAgo.js
new file mode 100644
index 000000000..e5d37b395
--- /dev/null
+++ b/client/coral-framework/components/TimeAgo.js
@@ -0,0 +1,35 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { timeago } from 'coral-framework/services/i18n';
+
+class TimeAgo extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { timeago: true };
+ }
+ toggleDate = () => this.setState({ timeago: !this.state.timeago });
+ render() {
+ var displayTime = this.state.timeago
+ ? timeago(this.props.datetime)
+ : new Date(this.props.datetime).toLocaleString();
+
+ var titleDate = !this.state.timeago
+ ? timeago(this.props.datetime)
+ : new Date(this.props.datetime).toLocaleString();
+ return (
+
+ {displayTime}
+
+ );
+ }
+}
+
+TimeAgo.propTypes = {
+ datetime: PropTypes.string,
+};
+
+export default TimeAgo;