From 518da0f30989b5ada73ee2cbfc95db8e18ac8758 Mon Sep 17 00:00:00 2001
From: MuslemRahimi
Date: Wed, 30 Oct 2024 18:56:18 +0100
Subject: [PATCH] bugfixing
---
.../stocks/[tickerID]/statistics/+page.svelte | 25 ++++++++++++++++---
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/src/routes/stocks/[tickerID]/statistics/+page.svelte b/src/routes/stocks/[tickerID]/statistics/+page.svelte
index ef7d7335..261f9c53 100644
--- a/src/routes/stocks/[tickerID]/statistics/+page.svelte
+++ b/src/routes/stocks/[tickerID]/statistics/+page.svelte
@@ -966,8 +966,9 @@
>
{#if rawData?.priceTarget && rawData?.upside && rawData?.analystRating}
The average price target for {$stockTicker} is ${rawData?.priceTarget},
- which is {rawData?.upside}% higher than the current price. The
- consensus rating is "{rawData?.analystRating}".
+ which is {rawData?.upside}% {rawData?.upside > 0
+ ? "higher"
+ : "lower"} than the current price. The consensus rating is "{rawData?.analystRating}".
{:else}
Currently there are no analyst rating for {$stockTicker}.
{/if}
@@ -1031,7 +1032,14 @@
class="mb-4 px-0.5 text-base leading-relaxed text-white xs:text-[1.05rem] lg:leading-normal"
data-test="statistics-text"
>
- The last stock split was on {rawData?.lastStockSplit} It was a
+ The last stock split was on {new Date(
+ rawData?.lastStockSplit,
+ ).toLocaleString("en-US", {
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ timeZone: "Europe/Berlin",
+ })}. It was a
{rawData?.splitType}
split with a ratio of {rawData?.splitRatio}.
@@ -1043,7 +1051,16 @@
{rawData?.lastStockSplit} | {new Date(rawData?.lastStockSplit).toLocaleString(
+ "en-US",
+ {
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ timeZone: "Europe/Berlin",
+ },
+ )}
|