diff --git a/src/routes/etf/[tickerID]/options/+page.svelte b/src/routes/etf/[tickerID]/options/+page.svelte
index 2c49f60c..81238ea0 100644
--- a/src/routes/etf/[tickerID]/options/+page.svelte
+++ b/src/routes/etf/[tickerID]/options/+page.svelte
@@ -526,15 +526,15 @@ $: {
- |
+ |
{formatTime(item?.time)}
|
-
+ |
{formatDate(item?.date)}
|
-
+ |
{item?.dte < 0 ? 'expired' : item?.dte +'d'}
|
diff --git a/src/routes/politicians/flow-data/+page.svelte b/src/routes/politicians/flow-data/+page.svelte
index 093dd613..4963841b 100644
--- a/src/routes/politicians/flow-data/+page.svelte
+++ b/src/routes/politicians/flow-data/+page.svelte
@@ -632,25 +632,25 @@
- assetSelector(item?.ticker, item?.assetType)} class="cursor-pointer text-start text-xs sm:text-sm text-blue-400">
+ | assetSelector(item?.ticker, item?.assetType)} class="cursor-pointer text-start whitespace-nowrap text-sm text-blue-400">
{item?.ticker?.length !== 0 ? item?.ticker : '-'}
{item?.assetDescription.length > charNumber ? formatString(item?.assetDescription.slice(0,charNumber)) + "..." : formatString(item?.assetDescription)?.replace("- Common Stock", "")?.replace("Common Stock", "")}
|
-
+ |
{new Date(item?.transactionDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
|
-
+ |
{new Date(item?.disclosureDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
|
-
+ |
{item?.amount?.replace("$1,000,001 - $5,000,000","$1Mio - $5Mio")}
|
-
+ |
{#if item?.type === 'Bought'}
Bought
{:else if item?.type === 'Sold'}
diff --git a/src/routes/stocks/[tickerID]/analyst/+page.svelte b/src/routes/stocks/[tickerID]/analyst/+page.svelte
index 855362ca..b6738b73 100644
--- a/src/routes/stocks/[tickerID]/analyst/+page.svelte
+++ b/src/routes/stocks/[tickerID]/analyst/+page.svelte
@@ -5,6 +5,7 @@ import InfoModal from '$lib/components/InfoModal.svelte';
import InfiniteLoading from '$lib/components/InfiniteLoading.svelte';
import { goto } from '$app/navigation';
import UpgradeToPro from '$lib/components/UpgradeToPro.svelte';
+import { Motion, AnimateSharedLayout } from "svelte-motion";
export let data;
@@ -17,10 +18,37 @@ let numOfAnalyst = 0;
let consensusRating = 'n/a';
let changesPercentage = 0;
-let filterRule = 'all';
+const tabs = [
+ {
+ title: "All Analysts",
+ },
+ {
+ title: "Top Analysts",
+ }
+];
+let activeIdx = 0;
+function changeTab(index) {
+ activeIdx = index;
+
+ if(Object?.keys(analystRating)?.length !== 0) {
+ numOfAnalyst = analystRating?.numOfAnalyst;
+ priceTarget = analystRating?.priceTarget
+ consensusRating = analystRating?.consensusRating;
+ changesPercentage = ((priceTarget/$currentPortfolioPrice -1)*100)?.toFixed(2) ?? 0;
+
+ }
+ if (activeIdx === 1) {
+ rawData = data?.getAnalystTickerHistory?.filter(item => item?.analystScore >=4)
+ historyList = rawData?.slice(0,10)
+ }
+ else {
+ rawData = data?.getAnalystTickerHistory ?? [];
+ historyList = rawData?.slice(0,10)
+ }
+}
async function infiniteHandler({ detail: { loaded, complete } })
{
@@ -34,29 +62,7 @@ if (historyList?.length === rawData?.length) {
}
}
-$: {
- if(filterRule) {
- if(Object?.keys(analystRating)?.length !== 0) {
- numOfAnalyst = analystRating?.numOfAnalyst;
- priceTarget = analystRating?.priceTarget
- consensusRating = analystRating?.consensusRating;
- changesPercentage = ((priceTarget/$currentPortfolioPrice -1)*100)?.toFixed(2) ?? 0;
-
-
- }
- if (filterRule === 'topAnalysts') {
- rawData = data?.getAnalystTickerHistory?.filter(item => item?.analystScore >=4)
- historyList = rawData?.slice(0,10)
- }
- else {
- rawData = data?.getAnalystTickerHistory ?? [];
- historyList = rawData?.slice(0,10)
- }
-
- }
-}
-
function latestInfoDate(inputDate) {
// Convert the input date string to milliseconds since epoch
@@ -75,6 +81,9 @@ function latestInfoDate(inputDate) {
return differenceInDays <=4;
}
+
+changeTab(0)
+
@@ -227,36 +236,50 @@ function latestInfoDate(inputDate) {
content={"Filter for analysts rated 4+ stars focusing on their win rate and average return per rating. Analysts with 4+ stars typically exhibit both high accuracy and high return per rating."}
id={"topAnalystsInfo"}
/>
-
- -
-
-
- -
- {#if data?.user?.tier === 'Pro'}
-
- {:else}
-
- Top Analysts
-
-
- {/if}
-
-
+
+
+
+ {#each tabs as item, i}
+
+ {/each}
+
+
+
-
-
-
+
{#if data?.user?.tier === 'Pro'}
diff --git a/src/routes/stocks/[tickerID]/options/+page.svelte b/src/routes/stocks/[tickerID]/options/+page.svelte
index 8c9db727..0d78e0e8 100644
--- a/src/routes/stocks/[tickerID]/options/+page.svelte
+++ b/src/routes/stocks/[tickerID]/options/+page.svelte
@@ -523,7 +523,7 @@ $: {
- |
+ |
{formatTime(item?.time)}
|
@@ -531,7 +531,7 @@ $: {
{formatDate(item?.date)}
-
+ |
{item?.dte < 0 ? 'expired' : item?.dte +'d'}
|
|