Skip to content

Commit 665d0e8

Browse files
authored
Merge pull request #2761 from objectcomputing/feature-2759/server-side-markdown
Attempt to fix sorting of comp history
2 parents 567cba1 + a0544d3 commit 665d0e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web-ui/src/pages/MeritReportPage.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,13 @@ const MeritReportPage = () => {
434434

435435
const prepareCompensationHistory = (data, fn) => {
436436
return data.compensationHistory.filter(fn).sort((a, b) => {
437-
for(let i = 0; i < a.length; i++) {
437+
for(let i = 0; i < a.startDate.length; i++) {
438438
if (a.startDate[i] != b.startDate[i]) {
439439
return b.startDate[i] - a.startDate[i];
440440
}
441441
}
442442
return 0;
443443
}).slice(0, 3);
444-
445444
};
446445

447446
const markdownCompensationHistory = (data) => {
@@ -453,9 +452,10 @@ const MeritReportPage = () => {
453452
text += markdown.lists.ul(compBase,
454453
(comp) => formatDate(dateFromArray(comp.startDate)) + " - " +
455454
"$" + parseFloat(comp.amount).toFixed(2) + " (base)");
455+
text += "\n";
456456
text += markdown.lists.ul(compTotal,
457457
(comp) => dateFromArray(comp.startDate).getFullYear() + " - " +
458-
comp.totalComp);
458+
comp.totalComp + " (total comp)");
459459
return text;
460460
};
461461

0 commit comments

Comments
 (0)