mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-01-22 03:35:42 +00:00
Fix frontend locale tests after date-fns changed intl formatting
and also attempt to format dates in locale
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { IconArrowsCross, IconBolt, IconBoltOff, IconDisc, IconLock, IconShield, IconUser } from "@tabler/icons-react";
|
||||
import cn from "classnames";
|
||||
import type { AuditLog } from "src/api/backend";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { formatDateTime, T } from "src/locale";
|
||||
|
||||
const getEventValue = (event: AuditLog) => {
|
||||
@@ -66,6 +67,7 @@ interface Props {
|
||||
row: AuditLog;
|
||||
}
|
||||
export function EventFormatter({ row }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
return (
|
||||
<div className="flex-fill">
|
||||
<div className="font-weight-medium">
|
||||
@@ -73,7 +75,7 @@ export function EventFormatter({ row }: Props) {
|
||||
<T id={`object.event.${row.action}`} tData={{ object: row.objectType }} />
|
||||
— <span className="badge">{getEventValue(row)}</span>
|
||||
</div>
|
||||
<div className="text-secondary mt-1">{formatDateTime(row.createdOn)}</div>
|
||||
<div className="text-secondary mt-1">{formatDateTime(row.createdOn, locale)}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user