Skip to content

Commit

Permalink
Sort certificate states (#469)
Browse files Browse the repository at this point in the history
* add certificate sorting
  • Loading branch information
immqu authored Oct 24, 2023
1 parent eb02105 commit 938654e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/CertificateCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 938654e

Please sign in to comment.