File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
libs/perun/services/src/lib Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,20 @@ import { MatPaginatorIntl } from '@angular/material/paginator';
5
5
export class CustomMatPaginator extends MatPaginatorIntl {
6
6
getRangeLabel = function ( page : number , pageSize : number , length : number ) : string {
7
7
let estimatedLength : string ;
8
+ const start = page * pageSize + 1 ;
9
+ const range = ( page + 1 ) * pageSize ;
10
+ const end = range > length ? length : range ;
11
+
8
12
if ( length < 1000 ) {
9
- estimatedLength = String ( length ) ;
13
+ return ` ${ start } – ${ end } of ${ String ( length ) } ` ;
10
14
} else if ( length < 10000 ) {
11
15
estimatedLength = '1 000' ;
12
16
} else if ( length < 100000 ) {
13
17
estimatedLength = '10 000' ;
14
18
} else {
15
19
estimatedLength = '100 000' ;
16
20
}
17
- const start = page * pageSize + 1 ;
18
- const end = ( page + 1 ) * pageSize ;
21
+
19
22
return `${ start } – ${ end } of ${ estimatedLength } +` ;
20
23
} ;
21
24
}
You can’t perform that action at this time.
0 commit comments