From de4b407f717bc4282520982350327ada1606c9bd Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 17 Oct 2021 21:46:15 -0400 Subject: [PATCH] Show original created time tooltip (#462) * Updating translations. * Show created and modified times on tippy. Fixes #438 --- lemmy-translations | 2 +- src/shared/components/common/moment-time.tsx | 26 +++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) 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)} ); } -- 2.44.1