Skip to content

Commit

Permalink
EPMRPP-96393 || Incorrect sorting in widgets and Firefox bug (#4077)
Browse files Browse the repository at this point in the history
  • Loading branch information
iso9000t authored Nov 1, 2024
1 parent 30f5273 commit 767f70c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ export const getLaunchModeConfig = ({
}) => {
const colors = {};
const columns = [];

const sortedResult = content.sort((item) => -item.number);
// EPMRPP-96393 (GitHub #2381): Changed sorting from -item.number to startTime-based sorting
// for consistency across all chart widgets. This ensures chronological ordering
// based on actual launch times rather than launch names/numbers.
const sortedResult = content.sort((a, b) => {
const startTimeA = new Date(a.startTime);
const startTimeB = new Date(b.startTime);
return startTimeA - startTimeB;
});
const itemsData = sortedResult.map((item) => ({
id: item.id,
name: item.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export const getConfigData = (
});

widgetData
.sort((a, b) => a.startTime - b.startTime)
.sort((a, b) => {
const startTimeA = new Date(a.startTime);
const startTimeB = new Date(b.startTime);
return startTimeA - startTimeB;
})
.forEach((item) => {
const currentItemData = {
...item,
Expand Down

0 comments on commit 767f70c

Please sign in to comment.