mirror of
https://github.com/owncast/owncast.git
synced 2025-11-03 04:27:18 +08:00
fix(admin): display year for user tables if not current year. Closes #3175
This commit is contained in:
@ -7,6 +7,11 @@ import { UserPopover } from './UserPopover';
|
|||||||
import { BanUserButton } from './BanUserButton';
|
import { BanUserButton } from './BanUserButton';
|
||||||
|
|
||||||
export function formatDisplayDate(date: string | Date) {
|
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');
|
return format(new Date(date), 'MMM d H:mma');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user