From a69fb1950240c9f1ac30517134aeb1190cc2cec7 Mon Sep 17 00:00:00 2001
From: esikkala <esko.ikkala@aalto.fi>
Date: Tue, 18 Jun 2019 12:19:05 +0300
Subject: [PATCH] Handle timespans with multiple values

---
 src/client/components/facet_results/ResultTableCell.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/client/components/facet_results/ResultTableCell.js b/src/client/components/facet_results/ResultTableCell.js
index ede5fead..f670c21b 100644
--- a/src/client/components/facet_results/ResultTableCell.js
+++ b/src/client/components/facet_results/ResultTableCell.js
@@ -27,6 +27,12 @@ const ResultTableCell = props => {
     let year;
     let month;
     let day;
+    /* TODO: remove this when data has been fixed
+       problematic example http://ldf.fi/mmm/time/production_229499
+    */
+    if (Array.isArray(str)) {
+      str = str[0];
+    }
     if (str.charAt(0) == '-') {
       year = parseInt(str.substring(0,5));
       month = parseInt(str.substring(7,8));
-- 
GitLab