Skip to content

Commit

Permalink
Fixed #13773
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Dec 1, 2023
1 parent c79a252 commit 0618958
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/utils/objectutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,12 @@ export class ObjectUtils {

public static sort(value1, value2, order = 1, locale, nullSortOrder = 1) {
const result = ObjectUtils.compare(value1, value2, locale, order);
let finalSortOrder = order;

// nullSortOrder == 1 means Excel like sort nulls at bottom
const finalSortOrder = nullSortOrder === 1 ? order : nullSortOrder;
if (ObjectUtils.isEmpty(value1) || ObjectUtils.isEmpty(value2)) {
finalSortOrder = nullSortOrder === 1 ? order : nullSortOrder;
}

return finalSortOrder * result;
}
Expand Down

0 comments on commit 0618958

Please sign in to comment.