From 429c66a5839ac2cc63450caf462453bbcc508de0 Mon Sep 17 00:00:00 2001 From: Kian Newman-Hazel Date: Thu, 9 Jan 2025 14:17:16 +0000 Subject: [PATCH] [Docs Site] Sort by sort_date in CompatibilityFlags component --- src/components/CompatibilityFlags.astro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/CompatibilityFlags.astro b/src/components/CompatibilityFlags.astro index 0cb70507dfdb53..b53477f57cbd11 100644 --- a/src/components/CompatibilityFlags.astro +++ b/src/components/CompatibilityFlags.astro @@ -16,6 +16,11 @@ let flags = await getCollection("compatibility-flags"); if (experimental) { flags = flags.filter((x) => x.data.experimental); } + +flags.sort( + (a, b) => + new Date(b.data.sort_date).getTime() - new Date(a.data.sort_date).getTime(), +); --- {