diff --git a/src/views/panes/InfoPane.tsx b/src/views/panes/InfoPane.tsx index 27f6872f..c7fde3ac 100644 --- a/src/views/panes/InfoPane.tsx +++ b/src/views/panes/InfoPane.tsx @@ -82,14 +82,21 @@ export const InfoPane: FunctionComponent = ( } else { exception.openings.sort((a, b) => { return Math.sign( - new Date(`${a.startDate} ${a.endDate}`).getTime() - - new Date(`${b.startDate} ${b.endDate}`).getTime(), + new Date(`${a.startDate}`).getTime() - + new Date(`${b.startDate}`).getTime(), ); }); ex.openings.push(exception); } }); + ex.openings.sort((a, b) => { + return Math.sign( + new Date(`${a.startDate}`).getTime() - + new Date(`${b.startDate}`).getTime(), + ); + }); + return { openings: generateExceptionalOpeningRows(intl, ex.openings), closures: ex.closures.map((exception) => ({ @@ -108,7 +115,7 @@ export const InfoPane: FunctionComponent = ( <>