From b7b18cede86d474f755c9ebff12698bc7fbe73d3 Mon Sep 17 00:00:00 2001 From: Mjumbe Wawatu Ukweli Date: Thu, 17 Jul 2014 14:53:07 -0400 Subject: [PATCH] Change the range helper to include both ends --- handlebars-helpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handlebars-helpers.js b/handlebars-helpers.js index 67ace6a..cde2646 100644 --- a/handlebars-helpers.js +++ b/handlebars-helpers.js @@ -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;