fixed bug in admin panel
This commit is contained in:
@@ -1,14 +1,7 @@
|
||||
export const formatDateTime = (value: string | null | undefined) => {
|
||||
if (!value) return "N/A";
|
||||
const inpDate = new Date(value);
|
||||
if (isNaN(inpDate.getTime())) return "N/A";
|
||||
return (
|
||||
inpDate.toLocaleString(undefined, {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
}) + " Uhr"
|
||||
);
|
||||
const m = value.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);
|
||||
if (!m) return "N/A";
|
||||
const [, y, M, d, h, min] = m;
|
||||
return `${d}.${M}.${y} ${h}:${min} Uhr`;
|
||||
};
|
||||
|
Reference in New Issue
Block a user