feat(admin dashboard): show createdAt

This commit is contained in:
Sebastian Pravda 2023-02-15 15:51:04 +01:00
parent aaeca06c33
commit d2cabea219
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
2 changed files with 13 additions and 0 deletions

View file

@ -3,6 +3,14 @@
import type { CandidatePreview } from '$lib/stores/candidate';
export let candidates: Array<CandidatePreview> = [];
const formatRustChronoDateTime = (date?: string) => {
if (!date) return '';
const [datePart, timePart] = date.split('T');
const [_, month, day] = datePart.split('-');
const [hour, minute, second] = timePart.split(':');
return `${day}. ${month}. ${hour}:${minute}:${Number(second).toFixed(0).padStart(2, '0')}`;
};
</script>
<div class="flex flex-col">
@ -16,6 +24,7 @@
<th scope="col"> Obor </th>
<th scope="col"> Rodné číslo </th>
<th scope="col"> Link </th>
<th scope="col"> Vytvořeno </th>
<th scope="col" />
</tr>
</thead>
@ -38,6 +47,9 @@
<td class="text-gray-900">
{candidate.relatedApplications?.filter((a) => a !== candidate.applicationId)}
</td>
<td class="text-gray-900">
{formatRustChronoDateTime(candidate.createdAt)}
</td>
<td class="text-sm">
<Delete id={candidate.applicationId} on:delete value="Odstranit" />
</td>

View file

@ -47,6 +47,7 @@ export interface CandidatePreview {
surname?: string;
email?: string;
fieldOfStudy?: string;
createdAt?: string;
}
export interface CandidateLogin {