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/VideoFeed.js
|
||||||
src/components/views/voip/VideoView.js
|
src/components/views/voip/VideoView.js
|
||||||
src/ContentMessages.js
|
src/ContentMessages.js
|
||||||
src/DateUtils.js
|
|
||||||
src/email.js
|
src/email.js
|
||||||
src/extend.js
|
src/extend.js
|
||||||
src/HtmlUtils.js
|
src/HtmlUtils.js
|
||||||
|
|
|
@ -61,17 +61,18 @@ function twelveHourTime(date) {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
formatDate: function(date, showTwelveHour=false) {
|
formatDate: function(date, showTwelveHour=false) {
|
||||||
var now = new Date();
|
const now = new Date();
|
||||||
const days = getDaysArray();
|
const days = getDaysArray();
|
||||||
const months = getMonthsArray();
|
const months = getMonthsArray();
|
||||||
if (date.toDateString() === now.toDateString()) {
|
if (date.toDateString() === now.toDateString()) {
|
||||||
return this.formatTime(date);
|
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
|
// TODO: use standard date localize function provided in counterpart
|
||||||
return _t('%(weekDayName)s %(time)s', {weekDayName: days[date.getDay()], time: this.formatTime(date, showTwelveHour)});
|
return _t('%(weekDayName)s %(time)s', {
|
||||||
}
|
weekDayName: days[date.getDay()],
|
||||||
else if (now.getFullYear() === date.getFullYear()) {
|
time: this.formatTime(date, showTwelveHour),
|
||||||
|
});
|
||||||
|
} else if (now.getFullYear() === date.getFullYear()) {
|
||||||
// TODO: use standard date localize function provided in counterpart
|
// TODO: use standard date localize function provided in counterpart
|
||||||
return _t('%(weekDayName)s, %(monthName)s %(day)s %(time)s', {
|
return _t('%(weekDayName)s, %(monthName)s %(day)s %(time)s', {
|
||||||
weekDayName: days[date.getDay()],
|
weekDayName: days[date.getDay()],
|
||||||
|
|
Loading…
Reference in New Issue