show date in admin ui report table
This commit is contained in:
@ -4,7 +4,6 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import DataTable from '@components/admin/table/DataTable.svelte';
|
import DataTable from '@components/admin/table/DataTable.svelte';
|
||||||
|
|
||||||
// consts
|
|
||||||
// consts
|
// consts
|
||||||
const dateFormat = new Intl.DateTimeFormat('de-DE', {
|
const dateFormat = new Intl.DateTimeFormat('de-DE', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
|
@ -4,6 +4,15 @@
|
|||||||
import DataTable from '@components/admin/table/DataTable.svelte';
|
import DataTable from '@components/admin/table/DataTable.svelte';
|
||||||
import { type StrikeReasons, getStrikeReasons, reports } from '@app/admin/reports/reports.ts';
|
import { type StrikeReasons, getStrikeReasons, reports } from '@app/admin/reports/reports.ts';
|
||||||
|
|
||||||
|
// consts
|
||||||
|
const dateFormat = new Intl.DateTimeFormat('de-DE', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit'
|
||||||
|
});
|
||||||
|
|
||||||
// states
|
// states
|
||||||
let strikeReasons = $state<StrikeReasons>([]);
|
let strikeReasons = $state<StrikeReasons>([]);
|
||||||
let activeReport = $state<Report | null>(null);
|
let activeReport = $state<Report | null>(null);
|
||||||
@ -14,6 +23,10 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#snippet date(value: string)}
|
||||||
|
{dateFormat.format(new Date(value))}
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
<DataTable
|
<DataTable
|
||||||
data={reports}
|
data={reports}
|
||||||
count={true}
|
count={true}
|
||||||
@ -21,11 +34,12 @@
|
|||||||
{ key: 'reason', label: 'Grund' },
|
{ key: 'reason', label: 'Grund' },
|
||||||
{ key: 'reporter.name', label: 'Report Team' },
|
{ key: 'reporter.name', label: 'Report Team' },
|
||||||
{ key: 'reported?.name', label: 'Reportetes Team' },
|
{ key: 'reported?.name', label: 'Reportetes Team' },
|
||||||
{ key: 'createdAt', label: 'Datum' },
|
{ key: 'createdAt', label: 'Datum', transform: date },
|
||||||
{ key: 'report.status?.status', label: 'Bearbeitungsstatus' }
|
{ key: 'report.status?.status', label: 'Bearbeitungsstatus' }
|
||||||
]}
|
]}
|
||||||
onClick={(report) => (activeReport = report)}
|
onClick={(report) => (activeReport = report)}
|
||||||
/>
|
>
|
||||||
|
</DataTable>
|
||||||
|
|
||||||
{#key activeReport}
|
{#key activeReport}
|
||||||
<BottomBar {strikeReasons} report={activeReport} />
|
<BottomBar {strikeReasons} report={activeReport} />
|
||||||
|
Reference in New Issue
Block a user