changeset 4487:80697ecc04e7

client: fix Identify problems with recency * Improve code for the case that no date_max value is present in a recency feature. The defect was introduced with changeset: 4575:4dad1d448876.
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 26 Sep 2019 17:22:44 +0200
parents e58fc3a62118
children bff6c5c1db4f
files client/src/components/identify/Identify.vue
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/identify/Identify.vue	Thu Sep 26 14:21:49 2019 +0200
+++ b/client/src/components/identify/Identify.vue	Thu Sep 26 17:22:44 2019 +0200
@@ -467,9 +467,15 @@
       const revisitingFactor = this.config.bn_revtime_multiplier;
       const revisitingTime = feature.get("revisiting_time");
       if (!revisitingTime) return [this.$gettext("No revisiting time defined")];
-      const latest = feature.get("date_max").replace("Z", "");
+      const latest = feature.get("date_max");
       if (!latest) return [this.$gettext("No survey-data available")];
-      const latestMeasurement = filters.surveyDate(new Date(latest));
+      const latestMeasurement = filters.surveyDate(
+        // remove a tailing "Z" if there is one, as some versions of
+        // firefox barf on it. The definition of Date Time String Format
+        // used for new Date() assumes UTC so it is okay, see
+        // http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
+        new Date(latest.replace("Z", ""))
+      );
       const messagesPerState = {
         OK: [
           this.$gettext("Data within the revisiting time") +