From: Dessalines Date: Mon, 18 Oct 2021 01:46:15 +0000 (-0400) Subject: Show original created time tooltip (#462) X-Git-Url: http://these/git/%24%7BgetStaticDir%28%29%7D/styles/static/%7BjoinLemmyUrl%7D?a=commitdiff_plain;h=de4b407f717bc4282520982350327ada1606c9bd;p=lemmy-ui.git Show original created time tooltip (#462) * Updating translations. * Show created and modified times on tippy. Fixes #438 --- diff --git a/lemmy-translations b/lemmy-translations index 2849552..0d6ef67 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 2849552043b167dd7e803da9dcbbf02f450f550a +Subproject commit 0d6ef6791f9175fb98ec99598c724d83e8e0d4ef diff --git a/src/shared/components/common/moment-time.tsx b/src/shared/components/common/moment-time.tsx index 2062393..122fbf7 100644 --- a/src/shared/components/common/moment-time.tsx +++ b/src/shared/components/common/moment-time.tsx @@ -23,13 +23,27 @@ export class MomentTime extends Component { moment.locale(lang); } + createdAndModifiedTimes() { + let created = this.props.data.published || this.props.data.when_; + return ` +
+
+ ${capitalizeFirstLetter(i18n.t("created"))}: ${this.format(created)} +
+
+ ${capitalizeFirstLetter(i18n.t("modified"))} ${this.format( + this.props.data.updated + )} +
+
`; + } + render() { if (!this.props.ignoreUpdated && this.props.data.updated) { return ( @@ -37,13 +51,13 @@ export class MomentTime extends Component { ); } else { - let str = this.props.data.published || this.props.data.when_; + let created = this.props.data.published || this.props.data.when_; return ( - {moment.utc(str).fromNow(!this.props.showAgo)} + {moment.utc(created).fromNow(!this.props.showAgo)} ); }