Change behaviour of DecoratedValue to handle dates better
@@ -33,12 +33,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.refine.browsing;
+import java.time.OffsetDateTime;
import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
import com.google.refine.Jsonizable;
+import com.google.refine.util.StringUtils;
/**
* Store a value and its text label, in case the value is not a string itself.
@@ -52,7 +54,11 @@ public class DecoratedValue implements Jsonizable {
final public String label;
public DecoratedValue(Object value, String label) {
+ if (value instanceof OffsetDateTime) {
+ this.value = StringUtils.toString(value);
+ } else {
this.value = value;
+ }
this.label = label;
}
