This commit is contained in:
MuslemRahimi 2025-04-01 17:34:32 +02:00
parent d29fc9e4a0
commit 40595fcdca
3 changed files with 28 additions and 37 deletions

View File

@ -220,21 +220,21 @@
hour: "numeric", hour: "numeric",
hour12: true, hour12: true,
}); });
return `<span class="font-[501] text-xs">${timeString.replace(/\s/g, " ")}</span>`; return `<span class="text-xs">${timeString.replace(/\s/g, " ")}</span>`;
} else if (["1W", "1M"].includes(displayData)) { } else if (["1W", "1M"].includes(displayData)) {
const timeString = date?.toLocaleDateString("en-US", { const timeString = date?.toLocaleDateString("en-US", {
month: "short", month: "short",
day: "numeric", day: "numeric",
timeZone: "UTC", timeZone: "UTC",
}); });
return `<span class="font-[501] text-xs">${timeString}</span>`; return `<span class="text-xs">${timeString}</span>`;
} else { } else {
const timeString = date?.toLocaleDateString("en-US", { const timeString = date?.toLocaleDateString("en-US", {
year: "2-digit", year: "2-digit",
month: "short", month: "short",
timeZone: "UTC", timeZone: "UTC",
}); });
return `<span class="font-[501] text-xs">${timeString}</span>`; return `<span class="text-xs">${timeString}</span>`;
} }
}, },
}, },
@ -750,7 +750,7 @@
>Bid</td >Bid</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{$wsBidPrice !== 0 && $wsBidPrice !== null >{$wsBidPrice !== 0 && $wsBidPrice !== null
? $wsBidPrice ? $wsBidPrice
: (data?.getStockQuote?.bid ?? "-")}</td : (data?.getStockQuote?.bid ?? "-")}</td
@ -763,7 +763,7 @@
>Market Cap</td >Market Cap</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{abbreviateNumber(data?.getStockQuote?.marketCap)}</td >{abbreviateNumber(data?.getStockQuote?.marketCap)}</td
></tr ></tr
> >
@ -774,7 +774,7 @@
>AUM</td >AUM</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{stockDeck?.aum !== null >{stockDeck?.aum !== null
? abbreviateNumber(stockDeck?.aum) ? abbreviateNumber(stockDeck?.aum)
: "n/a"}</td : "n/a"}</td
@ -787,7 +787,7 @@
>NAV</td >NAV</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{stockDeck?.nav !== null >{stockDeck?.nav !== null
? abbreviateNumber(stockDeck?.nav) ? abbreviateNumber(stockDeck?.nav)
: "n/a"}</td : "n/a"}</td
@ -801,7 +801,7 @@
>EPS (ttm)</td >EPS (ttm)</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.eps !== null >{data?.getStockQuote?.eps !== null
? data?.getStockQuote?.eps?.toFixed(2) ? data?.getStockQuote?.eps?.toFixed(2)
: "n/a"}</td : "n/a"}</td
@ -814,7 +814,7 @@
>PE Ratio (ttm)</td >PE Ratio (ttm)</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.pe !== null >{data?.getStockQuote?.pe !== null
? data?.getStockQuote?.pe?.toFixed(2) ? data?.getStockQuote?.pe?.toFixed(2)
: "n/a"}</td : "n/a"}</td
@ -828,7 +828,7 @@
>Shares Out >Shares Out
</td> </td>
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.sharesOutstanding !== null >{data?.getStockQuote?.sharesOutstanding !== null
? abbreviateNumber( ? abbreviateNumber(
data?.getStockQuote?.sharesOutstanding, data?.getStockQuote?.sharesOutstanding,
@ -843,7 +843,7 @@
>Inception Date</td >Inception Date</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{stockDeck?.inceptionDate !== null >{stockDeck?.inceptionDate !== null
? new Date(stockDeck?.inceptionDate)?.toLocaleString( ? new Date(stockDeck?.inceptionDate)?.toLocaleString(
"en-US", "en-US",
@ -868,7 +868,7 @@
>Ask</td >Ask</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{$wsAskPrice !== 0 && $wsAskPrice !== null >{$wsAskPrice !== 0 && $wsAskPrice !== null
? $wsAskPrice ? $wsAskPrice
: (data?.getStockQuote?.ask ?? "-")}</td : (data?.getStockQuote?.ask ?? "-")}</td
@ -881,7 +881,7 @@
>Volume</td >Volume</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{abbreviateNumber(data?.getStockQuote?.volume)}</td >{abbreviateNumber(data?.getStockQuote?.volume)}</td
></tr ></tr
> >
@ -892,7 +892,7 @@
>Open</td >Open</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.open?.toFixed(2)}</td >{data?.getStockQuote?.open?.toFixed(2)}</td
></tr ></tr
> >
@ -903,7 +903,7 @@
>Previous Close</td >Previous Close</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.previousClose?.toFixed(2)}</td >{data?.getStockQuote?.previousClose?.toFixed(2)}</td
></tr ></tr
> >
@ -914,7 +914,7 @@
>Day's Range</td >Day's Range</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.dayLow?.toFixed(2)} - {data?.getStockQuote?.dayHigh?.toFixed( >{data?.getStockQuote?.dayLow?.toFixed(2)} - {data?.getStockQuote?.dayHigh?.toFixed(
2, 2,
)}</td )}</td
@ -927,7 +927,7 @@
>52-Week Range</td >52-Week Range</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{data?.getStockQuote?.yearLow?.toFixed(2)} - {data?.getStockQuote?.yearHigh?.toFixed( >{data?.getStockQuote?.yearLow?.toFixed(2)} - {data?.getStockQuote?.yearHigh?.toFixed(
2, 2,
)}</td )}</td
@ -941,7 +941,7 @@
>Holdings >Holdings
</td> </td>
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{stockDeck?.holdingsCount !== null >{stockDeck?.holdingsCount !== null
? abbreviateNumber(stockDeck?.holdingsCount) ? abbreviateNumber(stockDeck?.holdingsCount)
: "n/a"}</td : "n/a"}</td
@ -954,7 +954,7 @@
>Expense Ratio</td >Expense Ratio</td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm font-semibold xs:px-1 sm:py-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-sm xs:px-1 sm:py-1 sm:text-right"
>{stockDeck?.expenseRatio !== null >{stockDeck?.expenseRatio !== null
? stockDeck?.expenseRatio?.toFixed(2) + "%" ? stockDeck?.expenseRatio?.toFixed(2) + "%"
: "n/a"}</td : "n/a"}</td

View File

@ -222,21 +222,21 @@
hour: "numeric", hour: "numeric",
hour12: true, hour12: true,
}); });
return `<span class="font-[501] text-xs">${timeString.replace(/\s/g, " ")}</span>`; return `<span class=" text-xs">${timeString.replace(/\s/g, " ")}</span>`;
} else if (["1W", "1M"].includes(displayData)) { } else if (["1W", "1M"].includes(displayData)) {
const timeString = date?.toLocaleDateString("en-US", { const timeString = date?.toLocaleDateString("en-US", {
month: "short", month: "short",
day: "numeric", day: "numeric",
timeZone: "UTC", timeZone: "UTC",
}); });
return `<span class="font-[501] text-xs">${timeString}</span>`; return `<span class=" text-xs">${timeString}</span>`;
} else { } else {
const timeString = date?.toLocaleDateString("en-US", { const timeString = date?.toLocaleDateString("en-US", {
year: "2-digit", year: "2-digit",
month: "short", month: "short",
timeZone: "UTC", timeZone: "UTC",
}); });
return `<span class="font-[501] text-xs">${timeString}</span>`; return `<span class=" text-xs">${timeString}</span>`;
} }
}, },
}, },
@ -776,7 +776,7 @@
></td ></td
> >
<td <td
class="whitespace-nowrap px-0.5 py-[1px] text-left text-[1rem] font-semibold xs:px-1 sm:text-right" class="whitespace-nowrap px-0.5 py-[1px] text-left text-[1rem] font-semibold dark:font-normal xs:px-1 sm:text-right"
>{@html abbreviateNumber( >{@html abbreviateNumber(
data?.getStockQuote?.marketCap, data?.getStockQuote?.marketCap,
false, false,

View File

@ -149,7 +149,6 @@
// Loop through each point in the shared tooltip // Loop through each point in the shared tooltip
this.points.forEach((point) => { this.points.forEach((point) => {
tooltipContent += ` tooltipContent += `
<span class="font-semibold text-sm">${point.series.name}:</span>
<span class="font-normal text-sm mt-1">${point?.y?.toLocaleString("en-US")}</span><br>`; <span class="font-normal text-sm mt-1">${point?.y?.toLocaleString("en-US")}</span><br>`;
}); });
@ -353,9 +352,7 @@
> >
<div> <div>
Employees Employees
<div <div class="mt-0.5 text-lg bp:text-xl sm:mt-1.5 sm:text-2xl">
class="mt-0.5 text-lg font-semibold bp:text-xl sm:mt-1.5 sm:text-2xl"
>
{#if Number(employees)} {#if Number(employees)}
{new Intl.NumberFormat("en")?.format(employees)} {new Intl.NumberFormat("en")?.format(employees)}
{:else} {:else}
@ -365,7 +362,7 @@
</div> </div>
<div> <div>
Change (1Y) <div Change (1Y) <div
class="mt-0.5 text-lg font-semibold bp:text-xl sm:mt-1.5 sm:text-2xl" class="mt-0.5 text-lg bp:text-xl sm:mt-1.5 sm:text-2xl"
> >
{#if dateDistance} {#if dateDistance}
n/a n/a
@ -385,9 +382,7 @@
</div> </div>
<div> <div>
Revenue / Employee Revenue / Employee
<div <div class="mt-0.5 text-lg bp:text-xl sm:mt-1.5 sm:text-2xl">
class="mt-0.5 text-lg font-semibold bp:text-xl sm:mt-1.5 sm:text-2xl"
>
{#if Number(data?.getStockDeck?.revenuePerEmployee)} {#if Number(data?.getStockDeck?.revenuePerEmployee)}
${new Intl.NumberFormat("en")?.format( ${new Intl.NumberFormat("en")?.format(
data?.getStockDeck?.revenuePerEmployee, data?.getStockDeck?.revenuePerEmployee,
@ -399,9 +394,7 @@
</div> </div>
<div> <div>
Profits / Employee Profits / Employee
<div <div class="mt-0.5 text-lg bp:text-xl sm:mt-1.5 sm:text-2xl">
class="mt-0.5 text-lg font-semibold bp:text-xl sm:mt-1.5 sm:text-2xl"
>
{#if Number(data?.getStockDeck?.profitPerEmployee)} {#if Number(data?.getStockDeck?.profitPerEmployee)}
{formatWithDollarSign(data?.getStockDeck?.profitPerEmployee)} {formatWithDollarSign(data?.getStockDeck?.profitPerEmployee)}
{:else} {:else}
@ -411,9 +404,7 @@
</div> </div>
<div> <div>
Market Cap Market Cap
<div <div class="mt-0.5 text-lg bp:text-xl sm:mt-1.5 sm:text-2xl">
class="mt-0.5 text-lg font-semibold bp:text-xl sm:mt-1.5 sm:text-2xl"
>
{@html abbreviateNumber( {@html abbreviateNumber(
data?.getStockQuote?.marketCap, data?.getStockQuote?.marketCap,
false, false,