Remove some instances of moment that are not needed on the index to reduce the load

This commit is contained in:
nitsua
2020-09-30 13:26:00 -04:00
committed by Qstick
parent 82eadcffaa
commit 5b83d09d5e
5 changed files with 21 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ import isInNextWeek from 'Utilities/Date/isInNextWeek';
import isToday from 'Utilities/Date/isToday';
import isTomorrow from 'Utilities/Date/isTomorrow';
import isYesterday from 'Utilities/Date/isYesterday';
import translate from 'Utilities/String/translate';
function getRelativeDate(date, shortDateFormat, showRelativeDates, { timeFormat, includeSeconds = false, timeForToday = false } = {}) {
if (!date) {
@@ -21,15 +22,15 @@ function getRelativeDate(date, shortDateFormat, showRelativeDates, { timeFormat,
}
if (isYesterday(date)) {
return 'Yesterday';
return translate('Yesterday');
}
if (isTodayDate) {
return 'Today';
return translate('Today');
}
if (isTomorrow(date)) {
return 'Tomorrow';
return translate('Tomorrow');
}
if (isInNextWeek(date)) {