I must be missing something. I have this function:
transform(value: number): string {
switch (value) {
case value > 1 && value < 86400:
return 'this';
break;
case value > 86401 && value < 259200:
return 'that';
break;
}
}
When I try to compile it, I get these errors:
ERROR in src/app/time-transform.pipe.ts:10:12 - error TS2678: Type 'boolean' is not comparable to type 'number'.
10 case value > 1 && value < 86400:
~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/time-transform.pipe.ts:13:12 - error TS2678: Type 'boolean' is not comparable to type 'number'.
13 case value > 86401 && value < 259200:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I want to be able to compare numbers. What am I missing here?