Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Jan 9, 2024
1 parent ab83b8d commit 23debd8
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,13 @@ export function getRangeDisplayValue(
const convert = formatter ? formatter.getConverterFor('text') : identity;
const { gte, gt, lte, lt } = params || {};

if (gte === undefined && lt === undefined && lte === undefined && gt === undefined) {
return '-';
}
const left = gte ?? gt ?? -Infinity;
const right = lte ?? lt ?? Infinity;

if (gte !== undefined && lt !== undefined) {
return `${convert(left)} to ${convert(right)}`;
if (left === -Infinity && right === Infinity) {
return '-';
}

if ((left !== -Infinity && right !== Infinity) || (left === -Infinity && right === Infinity)) {
if (left !== -Infinity && right !== Infinity) {
return `${convert(left)} to ${convert(right)}`;
} else if (left === -Infinity) {
return `< ${convert(right)}`;
Expand Down

0 comments on commit 23debd8

Please sign in to comment.