From b526fc057cc79fc641b7c291a56e74fb8a0d87af Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 14 Jan 2018 18:32:17 +0000 Subject: [PATCH] Add formatFullDateNoTime to DateUtils and stop passing 12/24h to DateSep --- src/DateUtils.js | 11 +++++++++++ src/components/structures/MessagePanel.js | 4 ++-- src/i18n/strings/en_EN.json | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/DateUtils.js b/src/DateUtils.js index 91df1e46d5b..986525eec8f 100644 --- a/src/DateUtils.js +++ b/src/DateUtils.js @@ -82,6 +82,17 @@ export function formatDate(date, showTwelveHour=false) { return formatFullDate(date, showTwelveHour); } +export function formatFullDateNoTime(date) { + const days = getDaysArray(); + const months = getMonthsArray(); + return _t('%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s', { + weekDayName: days[date.getDay()], + monthName: months[date.getMonth()], + day: date.getDate(), + fullYear: date.getFullYear(), + }); +} + export function formatFullDate(date, showTwelveHour=false) { const days = getDaysArray(); const months = getMonthsArray(); diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 5523fc27a01..6a8c2e9c2ef 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -325,7 +325,7 @@ module.exports = React.createClass({ const key = "membereventlistsummary-" + (prevEvent ? mxEv.getId() : "initial"); if (this._wantsDateSeparator(prevEvent, mxEv.getDate())) { - const dateSeparator =