diff options
author | ana <ana@ana.st> | 2021-08-08 19:00:00 +0200 |
---|---|---|
committer | ana <ana@ana.st> | 2021-08-08 19:00:00 +0200 |
commit | b03c4819262d1f65559ac7e389930297484b2979 (patch) | |
tree | 90f93e7d610eabe79c7a77cff0f473c029bfb0c0 | |
parent | 433169f9db9e9709f4bc6f903122bbd996eecc99 (diff) | |
download | eureka-marks-b03c4819262d1f65559ac7e389930297484b2979.tar.gz |
fix: correctly display expiration dates
-rw-r--r-- | src/App.svelte | 5 | ||||
-rw-r--r-- | src/bestiary.js | 1 |
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; } |