You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
de-lint DateUtils
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -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()],
|
||||||
|
|||||||
Reference in New Issue
Block a user