Issue 430 - Fix timeline facet to handle Calendar type as well as Date

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2379 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2011-11-17 23:52:32 +00:00
parent aef95e7c30
commit 23ac625818

View File

@ -33,6 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.refine.browsing.filters;
import java.util.Calendar;
import java.util.Date;
import com.google.refine.browsing.util.RowEvaluable;
@ -69,6 +70,9 @@ abstract public class ExpressionTimeComparisonRowFilter extends ExpressionNumber
if (v instanceof Date) {
long time = ((Date) v).getTime();
return _selectTime && checkValue(time);
} else if (v instanceof Calendar) {
long time = ((Calendar) v).getTime().getTime();
return _selectTime && checkValue(time);
} else {
return _selectNonTime;
}