You've already forked nginx-proxy-manager
mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-30 18:05:34 +03:00
16 lines
423 B
TypeScript
16 lines
423 B
TypeScript
import cn from "classnames";
|
|
import { isPast, parseISO } from "date-fns";
|
|
import { DateTimeFormat } from "src/locale";
|
|
|
|
interface Props {
|
|
value: string;
|
|
highlightPast?: boolean;
|
|
}
|
|
export function DateFormatter({ value, highlightPast }: Props) {
|
|
const dateIsPast = isPast(parseISO(value));
|
|
const cl = cn({
|
|
"text-danger": highlightPast && dateIsPast,
|
|
});
|
|
return <span className={cl}>{DateTimeFormat(value)}</span>;
|
|
}
|