about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorana <ana@ana.st>2021-08-08 19:00:00 +0200
committerana <ana@ana.st>2021-08-08 19:00:00 +0200
commitb03c4819262d1f65559ac7e389930297484b2979 (patch)
tree90f93e7d610eabe79c7a77cff0f473c029bfb0c0 /src
parent433169f9db9e9709f4bc6f903122bbd996eecc99 (diff)
downloadeureka-marks-b03c4819262d1f65559ac7e389930297484b2979.tar.gz
fix: correctly display expiration dates
Diffstat (limited to 'src')
-rw-r--r--src/App.svelte5
-rw-r--r--src/bestiary.js1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/App.svelte b/src/App.svelte
index c3471f1..1241d9f 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -5,6 +5,7 @@
   import { getMatches } from "./bestiary";
   import day from "dayjs";
   import relativeTime from "dayjs/plugin/relativeTime";
+  import { isNumber } from "util";
   day.extend(relativeTime);
 
   let date = new Date().getTime() * (1440 / 70);
@@ -95,7 +96,7 @@
       return f;
     });
 
-    if (i) {
+    if (typeof i === "number") {
       return `in ${day(getZoneForecast()[i + 1].date).fromNow()}`;
     }
     return "in the far future";
@@ -108,7 +109,7 @@
       return !f;
     });
 
-    if (i) {
+    if (typeof i === "number") {
       return `for another ${day(getZoneForecast()[i + 1].date).fromNow(true)}`;
     }
 
diff --git a/src/bestiary.js b/src/bestiary.js
index b09a613..f4a6937 100644
--- a/src/bestiary.js
+++ b/src/bestiary.js
@@ -32,6 +32,7 @@ export function getMatches(forecast, level) {
       });
     }
   });
+  console.log(res);
   return res;
 }