fix: list pengaduan dan list pelayanan surat
Deskripsi: - fix date string No Issues
This commit is contained in:
@@ -166,6 +166,7 @@ function ListPelayananSurat({ status }: { status: StatusKey }) {
|
|||||||
const totalPage = data?.data?.totalPages || 1;
|
const totalPage = data?.data?.totalPages || 1;
|
||||||
const pageSize = data?.data?.pageSize || 10;
|
const pageSize = data?.data?.pageSize || 10;
|
||||||
const pageNow = data?.data?.page || 1;
|
const pageNow = data?.data?.page || 1;
|
||||||
|
const toDate = (d: any) => new Date(d);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap="xl">
|
<Stack gap="xl">
|
||||||
@@ -232,7 +233,7 @@ function ListPelayananSurat({ status }: { status: StatusKey }) {
|
|||||||
#{v.noPengajuan}
|
#{v.noPengajuan}
|
||||||
</Title>
|
</Title>
|
||||||
<Text size="sm" c="dimmed">
|
<Text size="sm" c="dimmed">
|
||||||
{v.updatedAt}
|
{String(v.updatedAt)}
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -265,7 +266,7 @@ function ListPelayananSurat({ status }: { status: StatusKey }) {
|
|||||||
Tanggal Ajuan
|
Tanggal Ajuan
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Text size="md">{v.createdAt.toLocaleDateString("id-ID", { day: "numeric", month: "long", year: "numeric" })}</Text>
|
<Text size="md">{toDate(v.createdAt).toLocaleDateString("id-ID", { day: "numeric", month: "long", year: "numeric" })}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex direction={"column"} justify="flex-start">
|
<Flex direction={"column"} justify="flex-start">
|
||||||
<Group gap="xs">
|
<Group gap="xs">
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ function ListPengaduan({ status }: { status: StatusKey }) {
|
|||||||
const totalPage = data?.data?.totalPages || 1;
|
const totalPage = data?.data?.totalPages || 1;
|
||||||
const pageSize = data?.data?.pageSize || 10;
|
const pageSize = data?.data?.pageSize || 10;
|
||||||
const pageNow = data?.data?.page || 1;
|
const pageNow = data?.data?.page || 1;
|
||||||
|
const toDate = (d: any) => new Date(d);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -231,14 +232,14 @@ function ListPengaduan({ status }: { status: StatusKey }) {
|
|||||||
<Flex align="center" justify="space-between">
|
<Flex align="center" justify="space-between">
|
||||||
<Flex direction={"column"}>
|
<Flex direction={"column"}>
|
||||||
<Title order={3} c="gray.2">
|
<Title order={3} c="gray.2">
|
||||||
{v.title.toString()}
|
{v.title}
|
||||||
</Title>
|
</Title>
|
||||||
<Group>
|
<Group>
|
||||||
<Title order={6} c="gray.5">
|
<Title order={6} c="gray.5">
|
||||||
#{v.noPengaduan.toString()}
|
#{v.noPengaduan}
|
||||||
</Title>
|
</Title>
|
||||||
<Text size="sm" c="dimmed">
|
<Text size="sm" c="dimmed">
|
||||||
{v.updatedAt.toString()}
|
{String(v.updatedAt)}
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -271,7 +272,7 @@ function ListPengaduan({ status }: { status: StatusKey }) {
|
|||||||
Tanggal Aduan
|
Tanggal Aduan
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Text size="md">{v.createdAt.toLocaleDateString("id-ID", { day: "numeric", month: "long", year: "numeric" })}</Text>
|
<Text size="md">{toDate(v.createdAt).toLocaleDateString("id-ID", { day: "numeric", month: "long", year: "numeric" })}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex direction={"column"} justify="flex-start">
|
<Flex direction={"column"} justify="flex-start">
|
||||||
<Group gap="xs">
|
<Group gap="xs">
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ const PelayananRoute = new Elysia({
|
|||||||
category: item.CategoryPelayanan.name,
|
category: item.CategoryPelayanan.name,
|
||||||
warga: item.Warga.name,
|
warga: item.Warga.name,
|
||||||
status: item.status,
|
status: item.status,
|
||||||
createdAt: item.createdAt,
|
createdAt: item.createdAt.toISOString(),
|
||||||
updatedAt: 'terakhir diperbarui ' + getLastUpdated(item.updatedAt),
|
updatedAt: 'terakhir diperbarui ' + getLastUpdated(item.updatedAt),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -687,7 +687,7 @@ const PengaduanRoute = new Elysia({
|
|||||||
detail: item.detail,
|
detail: item.detail,
|
||||||
status: item.status,
|
status: item.status,
|
||||||
location: item.location,
|
location: item.location,
|
||||||
createdAt: item.createdAt,
|
createdAt: item.createdAt.toISOString(),
|
||||||
updatedAt: 'terakhir diperbarui ' + getLastUpdated(item.updatedAt),
|
updatedAt: 'terakhir diperbarui ' + getLastUpdated(item.updatedAt),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user