From 80854ab6bbd1ae8169cfbfd26cc83d77452aa27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 2 Apr 2021 09:25:21 +0200 Subject: [PATCH] Don't show seconds in ImageView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/DateUtils.ts | 4 ++-- src/components/views/elements/ImageView.js | 5 ++--- .../views/messages/MessageTimestamp.js | 18 ++++++++++++------ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/DateUtils.ts b/src/DateUtils.ts index 9b1edf0775..e4a1175d88 100644 --- a/src/DateUtils.ts +++ b/src/DateUtils.ts @@ -97,7 +97,7 @@ export function formatFullDateNoTime(date: Date): string { }); } -export function formatFullDate(date: Date, showTwelveHour = false): string { +export function formatFullDate(date: Date, showTwelveHour = false, showSeconds = true): string { const days = getDaysArray(); const months = getMonthsArray(); return _t('%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s', { @@ -105,7 +105,7 @@ export function formatFullDate(date: Date, showTwelveHour = false): string { monthName: months[date.getMonth()], day: date.getDate(), fullYear: date.getFullYear(), - time: formatFullTime(date, showTwelveHour), + time: showSeconds ? formatFullTime(date, showTwelveHour) : formatTime(date, showTwelveHour), }); } diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index e2d900117a..68a360d4b9 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -275,11 +275,10 @@ export default class ImageView extends React.Component { - + - ); const avatar = ( - { - this.props.showFullDate ? - formatFullDate(date, this.props.showTwelveHour) : - formatTime(date, this.props.showTwelveHour) - } + {timestamp} ); }