diff client/src/store/fairwayavailability.js @ 4468:130e929bab8f

available_fairway_depth_dialogue: more intuitive date selection
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 23 Sep 2019 16:16:42 +0200
parents a075da82e875
children 987a56071402
line wrap: on
line diff
--- a/client/src/store/fairwayavailability.js	Mon Sep 23 15:41:46 2019 +0200
+++ b/client/src/store/fairwayavailability.js	Mon Sep 23 16:16:42 2019 +0200
@@ -17,7 +17,6 @@
 import { HTTP } from "@/lib/http";
 import {
   format,
-  subYears,
   startOfMonth,
   endOfMonth,
   startOfYear,
@@ -43,10 +42,6 @@
   YEARLY: "yearly"
 };
 
-const isoFormat = date => {
-  return format(date, "YYYY-MM-DD");
-};
-
 const getIntervallBorders = (start, end, frequency) => {
   switch (frequency) {
     case FREQUENCIES.MONTHLY:
@@ -60,12 +55,16 @@
   }
 };
 
+const isoFormat = date => {
+  return format(date, "YYYY-MM-DD");
+};
+
 const init = () => {
   return {
     type: TYPES.BOTTLENECK,
     selectedFairwayAvailabilityFeature: null,
-    to: isoFormat(new Date()),
-    from: isoFormat(subYears(new Date(), 1)),
+    to: null,
+    from: null,
     frequency: FREQUENCIES.MONTHLY,
     limitingFactor: null,
     depthlimit1: 230,