From 4a5d3d466241e7e7e4107fb6866054584171d909 Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Sun, 26 May 2013 10:08:55 -0400 Subject: [PATCH] Convert dates to ISO 8601 for reconciliation. Fixes #688. --- .../com/google/refine/model/recon/StandardReconConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/src/com/google/refine/model/recon/StandardReconConfig.java b/main/src/com/google/refine/model/recon/StandardReconConfig.java index 3e7dad8eb..296a1a546 100644 --- a/main/src/com/google/refine/model/recon/StandardReconConfig.java +++ b/main/src/com/google/refine/model/recon/StandardReconConfig.java @@ -40,6 +40,8 @@ import java.io.StringWriter; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Properties; @@ -250,6 +252,10 @@ public class StandardReconConfig extends ReconConfig { jsonWriter.key("id"); jsonWriter.value(cell2.recon.match.id); jsonWriter.key("name"); jsonWriter.value(cell2.recon.match.name); jsonWriter.endObject(); + } else if (cell2.value instanceof Calendar) { + jsonWriter.value(ParsingUtilities.dateToString(((Calendar) cell2.value).getTime())); + } else if (cell2.value instanceof Date) { + jsonWriter.value(ParsingUtilities.dateToString((Date) cell2.value)); } else { jsonWriter.value(cell2.value.toString()); }