de-lint DateUtils
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
b937957609
commit
f514f1ff74
|
@ -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
|
||||
|
|
|
@ -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()],
|
||||
|
|
Loading…
Reference in New Issue