mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-02-03 01:12:52 +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,5 +1,6 @@
|
||||
import cn from "classnames";
|
||||
import type { ReactNode } from "react";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { formatDateTime, T } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
@@ -37,7 +38,9 @@ const DomainLink = ({ domain, color }: { domain?: string; color?: string }) => {
|
||||
};
|
||||
|
||||
export function DomainsFormatter({ domains, createdOn, niceName, provider, color }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
const elms: ReactNode[] = [];
|
||||
|
||||
if ((!domains || domains.length === 0) && !niceName) {
|
||||
elms.push(
|
||||
<span key="nice-name" className="badge bg-danger-lt me-2">
|
||||
@@ -62,7 +65,7 @@ export function DomainsFormatter({ domains, createdOn, niceName, provider, color
|
||||
<div className="font-weight-medium">{...elms}</div>
|
||||
{createdOn ? (
|
||||
<div className="text-secondary mt-1">
|
||||
<T id="created-on" data={{ date: formatDateTime(createdOn) }} />
|
||||
<T id="created-on" data={{ date: formatDateTime(createdOn, locale) }} />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user