fix(admin): display year for user tables if not current year. Closes #3175

This commit is contained in:
Gabe Kangas 2023-07-16 16:46:09 -07:00
parent 0c3f317f13
commit d43c2be44a
No known key found for this signature in database
GPG Key ID: 4345B2060657F330

View File

@ -7,6 +7,11 @@ import { UserPopover } from './UserPopover';
import { BanUserButton } from './BanUserButton';
export function formatDisplayDate(date: string | Date) {
const d = new Date(date);
if (d.getFullYear() !== new Date().getFullYear()) {
return format(new Date(date), 'MMM d, yyyy H:mma');
}
return format(new Date(date), 'MMM d H:mma');
}