Skip to content

Commit

Permalink
fix: Order maintenance by schedule date asc
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-code authored and lorenzo-cavazzi committed Dec 20, 2021
1 parent 14a492b commit 1899e26
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/statuspage/Statuspage.present.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ function SiteStatusLanding(props) {
* @param {array} maintenances
*/
function sortedMaintenances(maintenances) {
maintenances.sort((a, b) => a.scheduled_for < b.scheduled_for);
return maintenances;
return maintenances.sort((a, b) => {
return (new Date(a.scheduled_for) < new Date(b.scheduled_for)) ?
-1 :
1;
});
}

function maintenanceTimeFragment(first) {
Expand Down

0 comments on commit 1899e26

Please sign in to comment.