File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/components/ui/dashboard Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,18 @@ export function DynamicApiSelect<T>({
65
65
filterFn : ( session : CoachingSession ) => boolean
66
66
) => {
67
67
const filteredSessions = sessions . filter ( filterFn ) ;
68
+
69
+ const sortedSessions = filteredSessions . sort (
70
+ ( a , b ) =>
71
+ DateTime . fromISO ( a . date . toString ( ) ) . toMillis ( ) -
72
+ DateTime . fromISO ( b . date . toString ( ) ) . toMillis ( )
73
+ ) ;
74
+
68
75
return (
69
- filteredSessions . length > 0 && (
76
+ sortedSessions . length > 0 && (
70
77
< SelectGroup >
71
78
< SelectLabel > { label } </ SelectLabel >
72
- { filteredSessions . map ( ( session ) => (
79
+ { sortedSessions . map ( ( session ) => (
73
80
< SelectItem value = { session . id } key = { session . id } >
74
81
{ DateTime . fromISO ( session . date . toString ( ) ) . toLocaleString (
75
82
DateTime . DATETIME_FULL
You can’t perform that action at this time.
0 commit comments