From 8d422e2e5441b577c2faaf6381337fa2442e050c Mon Sep 17 00:00:00 2001 From: David Huynh Date: Tue, 26 Oct 2010 21:06:16 +0000 Subject: [PATCH] Fixed Calendar vs. Date bug in time range facet git-svn-id: http://google-refine.googlecode.com/svn/trunk@1699 7d457c2a-affb-35e4-300a-418c747d4874 --- .../refine/browsing/util/ExpressionTimeValueBinner.java | 5 +++++ main/webapp/modules/core/scripts/facets/timerange-facet.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main/src/com/google/refine/browsing/util/ExpressionTimeValueBinner.java b/main/src/com/google/refine/browsing/util/ExpressionTimeValueBinner.java index e4606adbb..6f2bb4b45 100644 --- a/main/src/com/google/refine/browsing/util/ExpressionTimeValueBinner.java +++ b/main/src/com/google/refine/browsing/util/ExpressionTimeValueBinner.java @@ -33,6 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.refine.browsing.util; +import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.Properties; @@ -161,6 +162,10 @@ public class ExpressionTimeValueBinner implements RowVisitor, RecordVisitor { if (ExpressionUtils.isError(value)) { hasError = true; } else if (ExpressionUtils.isNonBlankData(value)) { + if (value instanceof Calendar) { + value = ((Calendar) value).getTime(); + } + if (value instanceof Date) { long t = ((Date) value).getTime(); hasTime = true; diff --git a/main/webapp/modules/core/scripts/facets/timerange-facet.js b/main/webapp/modules/core/scripts/facets/timerange-facet.js index 8c298c7e8..223ceaf56 100644 --- a/main/webapp/modules/core/scripts/facets/timerange-facet.js +++ b/main/webapp/modules/core/scripts/facets/timerange-facet.js @@ -50,7 +50,7 @@ function TimeRangeFacet(div, config, options) { this._baseBlankCount = 0; this._baseErrorCount = 0; - this._TimeCount = 0; + this._timeCount = 0; this._nonTimeCount = 0; this._blankCount = 0; this._errorCount = 0;