File tree Expand file tree Collapse file tree
pages/hackathon/[id]/team Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 isPublicForm ,
2020 relationNameOf ,
2121 textListOf ,
22+ timeOf ,
2223 userOf ,
2324} from '../../../../components/Activity/Hackathon/utility' ;
2425import { ProductCard } from '../../../../components/Activity/ProductCard' ;
@@ -127,10 +128,16 @@ const ProjectPage: FC<ProjectPageProps> = observer(
127128 const scoreText = firstTextOf ( score ) ;
128129 const rankText = firstTextOf ( rank ) ;
129130 const prizeText = firstTextOf ( prize ) ;
130- const agendaItems = [ ...agenda ] . sort (
131- ( { startedAt : left } , { startedAt : right } ) =>
132- new Date ( ( left as string ) || 0 ) . getTime ( ) - new Date ( ( right as string ) || 0 ) . getTime ( ) ,
133- ) ;
131+ const agendaItems = [ ...agenda ] . sort ( ( { startedAt : left } , { startedAt : right } ) => {
132+ const leftTime = timeOf ( left ) ;
133+ const rightTime = timeOf ( right ) ;
134+
135+ if ( ! Number . isFinite ( leftTime ) && ! Number . isFinite ( rightTime ) ) return 0 ;
136+ if ( ! Number . isFinite ( leftTime ) ) return 1 ;
137+ if ( ! Number . isFinite ( rightTime ) ) return - 1 ;
138+
139+ return leftTime - rightTime ;
140+ } ) ;
134141 const phaseBadges = agendaItems
135142 . slice ( 0 , 4 )
136143 . map ( ( { type, startedAt, endedAt } ) => {
You can’t perform that action at this time.
0 commit comments