diff --git a/.eslintignore.errorfiles b/.eslintignore.errorfiles index 1814d7ee83..06e810bd9c 100644 --- a/.eslintignore.errorfiles +++ b/.eslintignore.errorfiles @@ -116,7 +116,6 @@ src/components/views/voip/IncomingCallBox.js src/components/views/voip/VideoFeed.js src/components/views/voip/VideoView.js src/ContentMessages.js -src/DateUtils.js src/email.js src/extend.js src/HtmlUtils.js diff --git a/src/DateUtils.js b/src/DateUtils.js index 545d92dd3b..0f3aa01bc8 100644 --- a/src/DateUtils.js +++ b/src/DateUtils.js @@ -61,17 +61,18 @@ function twelveHourTime(date) { module.exports = { formatDate: function(date, showTwelveHour=false) { - var now = new Date(); + const now = new Date(); const days = getDaysArray(); const months = getMonthsArray(); if (date.toDateString() === now.toDateString()) { return this.formatTime(date); - } - else if (now.getTime() - date.getTime() < 6 * 24 * 60 * 60 * 1000) { + } else if (now.getTime() - date.getTime() < 6 * 24 * 60 * 60 * 1000) { // TODO: use standard date localize function provided in counterpart - return _t('%(weekDayName)s %(time)s', {weekDayName: days[date.getDay()], time: this.formatTime(date, showTwelveHour)}); - } - else if (now.getFullYear() === date.getFullYear()) { + return _t('%(weekDayName)s %(time)s', { + weekDayName: days[date.getDay()], + time: this.formatTime(date, showTwelveHour), + }); + } else if (now.getFullYear() === date.getFullYear()) { // TODO: use standard date localize function provided in counterpart return _t('%(weekDayName)s, %(monthName)s %(day)s %(time)s', { weekDayName: days[date.getDay()],