Skip to content

Commit

Permalink
Change the range helper to include both ends
Browse files Browse the repository at this point in the history
  • Loading branch information
mjumbewu committed Jul 17, 2014
1 parent 13ec8e8 commit b7b18ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion handlebars-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
});

Handlebars.registerHelper('range', function(from, to, options) {
// Range is INCLUSIVE of the ends. Useful for things like
// pagination links.
var accum = '', i;
for(i = from; i < to; i++){
for(i = from; i <= to; i++){
accum += options.fn(i);
}
return accum;
Expand Down

0 comments on commit b7b18ce

Please sign in to comment.