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
This commit is contained in:
David Huynh 2010-10-26 21:06:16 +00:00
parent dfa9c538c7
commit 8d422e2e54
2 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.refine.browsing.util; package com.google.refine.browsing.util;
import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.Properties; import java.util.Properties;
@ -161,6 +162,10 @@ public class ExpressionTimeValueBinner implements RowVisitor, RecordVisitor {
if (ExpressionUtils.isError(value)) { if (ExpressionUtils.isError(value)) {
hasError = true; hasError = true;
} else if (ExpressionUtils.isNonBlankData(value)) { } else if (ExpressionUtils.isNonBlankData(value)) {
if (value instanceof Calendar) {
value = ((Calendar) value).getTime();
}
if (value instanceof Date) { if (value instanceof Date) {
long t = ((Date) value).getTime(); long t = ((Date) value).getTime();
hasTime = true; hasTime = true;

View File

@ -50,7 +50,7 @@ function TimeRangeFacet(div, config, options) {
this._baseBlankCount = 0; this._baseBlankCount = 0;
this._baseErrorCount = 0; this._baseErrorCount = 0;
this._TimeCount = 0; this._timeCount = 0;
this._nonTimeCount = 0; this._nonTimeCount = 0;
this._blankCount = 0; this._blankCount = 0;
this._errorCount = 0; this._errorCount = 0;