From 7a81a0c0cf6fa3970615674278e47b795a0f742e Mon Sep 17 00:00:00 2001 From: Stephen Demjanenko Date: Wed, 15 Apr 2015 13:04:27 -0700 Subject: [PATCH] Fix bug in findApplicableRules: ruleset start/end years might be strings Doing a === check assumes its an int which is not safe. If one uses the node-preparse.js script you will get strings returned for these fields. --- src/date.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/date.js b/src/date.js index 5de8230..cca0286 100644 --- a/src/date.js +++ b/src/date.js @@ -804,7 +804,7 @@ // Date is in a set range. ruleset[i][1] >= year || // Date is in an 'only' year. - (ruleset[i][0] === year && ruleset[i][1] === 'only') || + (ruleset[i][0] == year && ruleset[i][1] === 'only') || //We're in a range from the start year to infinity. ruleset[i][1] === 'max' )