fixed bug/issue: #9
This commit is contained in:
@@ -21,9 +21,10 @@ type Loan = {
|
|||||||
|
|
||||||
const formatDate = (iso: string | null) => {
|
const formatDate = (iso: string | null) => {
|
||||||
if (!iso) return "-";
|
if (!iso) return "-";
|
||||||
const d = new Date(iso);
|
const m = iso.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);
|
||||||
if (Number.isNaN(d.getTime())) return iso;
|
if (!m) return iso;
|
||||||
return d.toLocaleString("de-DE", { dateStyle: "short", timeStyle: "short" });
|
const [, y, M, d, h, min] = m;
|
||||||
|
return `${d}.${M}.${y} ${h}:${min}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
async function fetchUserLoans(): Promise<Loan[]> {
|
async function fetchUserLoans(): Promise<Loan[]> {
|
||||||
|
Reference in New Issue
Block a user