From d1662d75c8f055a996881b720fc9834acd0a6c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 22 Dec 2020 09:45:35 +0100 Subject: [PATCH] feat: Add last seen at timestamp Closes #226 --- .../src/component/feature/view/metric-component.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/feature/view/metric-component.jsx b/frontend/src/component/feature/view/metric-component.jsx index 0bde8de5f9..e883b34927 100644 --- a/frontend/src/component/feature/view/metric-component.jsx +++ b/frontend/src/component/feature/view/metric-component.jsx @@ -51,6 +51,10 @@ export default class MetricComponent extends React.Component { formatFullDateTime(v) { return formatFullDateTimeWithLocale(v, this.props.location.locale); } + renderLastSeen = lastSeenAt => { + return lastSeenAt ? this.formatFullDateTime(lastSeenAt) : 'Never reported'; + }; + render() { const { metrics = {}, featureToggle } = this.props; const { @@ -113,7 +117,13 @@ export default class MetricComponent extends React.Component { )} - Created {this.formatFullDateTime(featureToggle.createdAt)} +
+ Created: + {this.formatFullDateTime(featureToggle.createdAt)} +
+ Last seen: + {this.renderLastSeen(featureToggle.lastSeenAt)} +