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