Skip to content

Commit e9287ef

Browse files
authored
toil(front): always display time for non relative dates (#647)
## πŸ“ Description Always display time for non-relative dates ## βœ… Checklist - [x] I have tested this change - [x] ~This change requires documentation update~
1 parent d73f6da commit e9287ef

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

β€Žfront/assets/js/time_ago.jsβ€Ž

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class TimeAgo extends HTMLElement {
3636
const diffInHours = Math.floor(diffInSeconds / 3600);
3737
const daysDifference = Math.floor(diffInSeconds / 86400);
3838

39-
if (daysDifference > 3) return this.formatFullDate(date);
4039
if (diffInHours >= 1) return this.formatDateWithTime(date);
4140
return this.formatRelativeTime(diffInSeconds);
4241
}
@@ -49,16 +48,6 @@ class TimeAgo extends HTMLElement {
4948
return rtf.format(-Math.floor(seconds / 3600), "hour");
5049
}
5150

52-
formatFullDate(date) {
53-
const options = { weekday: "short", day: "numeric", month: "short", year: "numeric" };
54-
const formattedDate = date.toLocaleDateString(this.locale, options);
55-
56-
const [weekday, month, day, year] = formattedDate.replaceAll(",", "").split(" ");
57-
const suffixedDay = day + this.ordinalSuffix(parseInt(day, 10));
58-
59-
return `on ${weekday} ${suffixedDay} ${month} ${year}`;
60-
}
61-
6251
formatDateWithTime(date) {
6352
const options = { weekday: "short", day: "numeric", month: "short", year: "numeric", hour: "2-digit", minute: "2-digit", hour12: false };
6453
const formattedDate = date.toLocaleDateString(this.locale, options);

0 commit comments

Comments
Β (0)