From 938654e0e701e03c38a1eda94e2a220e215da5d8 Mon Sep 17 00:00:00 2001 From: Immanuel Kunz Date: Tue, 24 Oct 2023 11:57:44 +0200 Subject: [PATCH] Sort certificate states (#469) * add certificate sorting --- src/lib/CertificateCard.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/CertificateCard.svelte b/src/lib/CertificateCard.svelte index 23a6110..61cf9a0 100644 --- a/src/lib/CertificateCard.svelte +++ b/src/lib/CertificateCard.svelte @@ -5,9 +5,9 @@ import type { Certificate, State } from '$lib/orchestrator'; export let certificate: Certificate; let states = certificate.states -var sortedStates: State[] = states.sort( +let sortedStates = states.sort( (s1,s2) => { - if (new Date(s1.timestamp) < new Date(s2.timestamp)){ + if (new Date(s1.timestamp.replace(/[A-Z]+$/i, 'UTC')) > new Date(s2.timestamp.replace(/[A-Z]+$/i, 'UTC'))){ return 1 } else { return 0