Make date-rendering consistent: show year if older than six months

This commit is contained in:
Scott Nonnenberg
2026-01-14 06:01:53 +10:00
committed by GitHub
parent 560224f516
commit 91f8176c12

View File

@@ -120,7 +120,7 @@ export function formatDateTimeShort(
return formatTimestamp(timestamp, { weekday: 'short' });
}
if (m.isSame(now, 'year')) {
if (Math.abs(m.diff(Date.now())) < 6 * MONTH) {
return formatTimestamp(timestamp, {
day: 'numeric',
month: 'short',
@@ -157,7 +157,7 @@ export function formatDateTimeForAttachment(
});
}
if (m.isSame(now, 'year')) {
if (Math.abs(m.diff(Date.now())) < 6 * MONTH) {
return formatTimestamp(timestamp, {
day: 'numeric',
month: 'short',