diff --git a/frontend/src/hooks/useFeaturesSort.ts b/frontend/src/hooks/useFeaturesSort.ts index a72c2fc295..fd5415c246 100644 --- a/frontend/src/hooks/useFeaturesSort.ts +++ b/frontend/src/hooks/useFeaturesSort.ts @@ -109,17 +109,19 @@ const sortByLastSeen = ( ): IFeatureToggle[] => { return [...features].sort((a, b) => a.lastSeenAt && b.lastSeenAt - ? a.lastSeenAt.localeCompare(b.lastSeenAt) - : 0 + ? b.lastSeenAt.localeCompare(a.lastSeenAt) + : a.lastSeenAt + ? -1 + : b.lastSeenAt + ? 1 + : b.createdAt.localeCompare(a.createdAt) ); }; const sortByCreated = ( features: Readonly ): IFeatureToggle[] => { - return [...features].sort((a, b) => - new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1 - ); + return [...features].sort((a, b) => b.createdAt.localeCompare(a.createdAt)); }; const sortByName = (features: Readonly): IFeatureToggle[] => {