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.css b/client/coral-framework/components/TimeAgo.css
new file mode 100644
index 000000000..e15e6720e
--- /dev/null
+++ b/client/coral-framework/components/TimeAgo.css
@@ -0,0 +1,3 @@
+.timeago {
+ cursor: pointer;
+}
diff --git a/client/coral-framework/components/TimeAgo.js b/client/coral-framework/components/TimeAgo.js
new file mode 100644
index 000000000..682018b38
--- /dev/null
+++ b/client/coral-framework/components/TimeAgo.js
@@ -0,0 +1,42 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { timeago } from 'coral-framework/services/i18n';
+import cn from 'classnames';
+import styles from './TimeAgo.css';
+
+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,
+ className: PropTypes.string,
+};
+
+export default TimeAgo;