de-lint DateUtils

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2017-07-01 14:42:12 +01:00
parent b937957609
commit f514f1ff74
No known key found for this signature in database
GPG Key ID: 0435A1D4BBD34D64
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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()],