Skip to content

Commit

Permalink
Fixed #1251 - currentPageReport should check for {last} boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Mar 11, 2020
1 parent 6ccde29 commit 201b11b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/paginator/CurrentPageReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ export class CurrentPageReport extends Component {
totalRecords: PropTypes.number,
template: PropTypes.string
}

render() {
let text = this.props.template
.replace("{currentPage}", this.props.page + 1)
.replace("{totalPages}", this.props.pageCount)
.replace("{first}", this.props.first + 1)
.replace("{last}", this.props.first + this.props.rows)
.replace("{last}", Math.min(this.props.first + this.props.rows, this.props.totalRecords))
.replace("{rows}", this.props.rows)
.replace("{totalRecords}", this.props.totalRecords);

return <span className="p-paginator-current">{text}</span>
}
}
}

0 comments on commit 201b11b

Please sign in to comment.