bugfixing

This commit is contained in:
MuslemRahimi 2024-11-03 21:47:30 +01:00
parent 80a41848fc
commit 50fd19cb81

View File

@ -382,21 +382,21 @@
{#if index === selectedWeekday} {#if index === selectedWeekday}
{#if day?.length !== 0} {#if day?.length !== 0}
<h2 class="font-semibold text-white text-xl mt-5"> <h2 class="font-semibold text-white text-xl mt-5">
{formattedWeekday[index]?.split(", ")[1]} · {day?.length} Dividends {formattedWeekday[index]?.split(", ")[1]} · {day?.length} Earnings
</h2> </h2>
<div class="w-full overflow-x-scroll no-scrollbar"> <div class="w-full overflow-x-scroll no-scrollbar">
<table <table
class="table table-sm table-compact rounded-none sm:rounded-md w-full border-[#09090B] m-auto mt-4" class="table table-sm table-compact rounded-none sm:rounded-md w-full bg-[#09090B] border-bg-[#09090B] m-auto mt-4"
> >
<thead> <thead>
<tr <tr class="whitespace-nowrap">
class="whitespace-nowrap border-b border-[#27272A]" <th
> class="text-start text-white font-semibold text-sm"
<th class="text-white font-semibold text-sm"
>Symbol</th >Symbol</th
> >
<th class="text-white font-semibold text-sm" <th
class="text-start text-white font-semibold text-sm"
>Company Name</th >Company Name</th
> >
<th <th
@ -405,45 +405,44 @@
> >
<th <th
class="text-white font-semibold text-sm text-end" class="text-white font-semibold text-sm text-end"
>Revenue</th >Revenue Estimate</th
>
<th
class="text-white font-semibold text-sm text-end"
>Cash Amount</th
> >
<th <th
class="text-white font-semibold text-sm text-end" class="text-white font-semibold text-sm text-end"
>Payment Date</th >EPS Estimate</th
>
<th
class="text-white font-semibold text-sm text-end text-end"
>Earnings Time</th
> >
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{#each day as item} {#each day as item, index}
<!-- row --> <!-- row -->
<tr <tr
class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] border-b-[#09090B]" class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] border-b-[#09090B]"
> >
<td <td
class="border-b-[#09090B] text-sm sm:text-[1rem]" class="text-blue-400 border-b-[#09090B] text-start text-sm sm:text-[1rem]"
> >
<a <a
href={"/stocks/" + item?.symbol} href={"/stocks/" + item?.symbol}
class="text-blue-400 sm:hover:text-white" class="sm:hover:text-white text-blue-400"
>{item?.symbol} >{item?.symbol}</a
</a> >
</td> </td>
<td <td
class="text-white border-b-[#09090B] whitespace-nowrap text-sm sm:text-[1rem]" class="text-white whitespace-nowrap text-sm sm:text-[1rem] border-b-[#09090B]"
> >
{item?.name.length > 20 {item?.name.length > 20
? item?.name.slice(0, 20) + "..." ? item?.name?.slice(0, 20) + "..."
: item?.name} : item?.name}
</td> </td>
<td <td
class="text-white border-b-[#09090B] text-sm text-end sm:text-[1rem]" class="text-white border-b-[#09090B] text-end text-sm sm:text-[1rem]"
> >
{item?.marketCap !== null {item?.marketCap !== null
? abbreviateNumber(item?.marketCap) ? abbreviateNumber(item?.marketCap)
@ -451,35 +450,101 @@
</td> </td>
<td <td
class="text-white border-b-[#09090B] text-sm sm:text-[1rem] text-end" class="text-white text-end border-b-[#09090B] text-sm sm:text-[1rem]"
> >
{item?.revenue !== null <div
? abbreviateNumber(item?.revenue) class="flex flex-row items-center justify-end"
: "-"} >
</td> <span>
{item?.revenueEst !== null
<td ? abbreviateNumber(item?.revenueEst)
class="text-white border-b-[#09090B] text-center text-sm sm:text-[1rem] text-end" : "-"}
> </span>
{item?.adjDividend !== null {#if item?.revenueEst !== null && item?.revenueEst !== null}
? item?.adjDividend?.toFixed(3) {#if item?.revenueEst / item?.revenuePrior - 1 >= 0}
: "-"} <span class="ml-1 text-[#22C55E]">
+{(
(item?.revenueEst /
item?.revenuePrior -
1) *
100
)?.toFixed(2)}%
</span>
{:else}
<span class="ml-1 text-[#FF2F1F]">
{(
(item?.revenueEst /
item?.revenuePrior -
1) *
100
)?.toFixed(2)}%
</span>
{/if}
{/if}
</div>
</td> </td>
<td <td
class="text-white text-end border-b-[#09090B] text-sm sm:text-[1rem]" class="text-white text-end border-b-[#09090B] text-sm sm:text-[1rem]"
> >
{item?.paymentDate !== null <div
? new Date(item?.paymentDate)?.toLocaleString( class="flex flex-row items-center justify-end"
"en-US", >
{ <span>
month: "short", {item?.epsEst !== null
day: "numeric", ? item?.epsEst?.toFixed(2)
year: "numeric", : "-"}
daySuffix: "2-digit", </span>
}, {#if item?.epsEst !== null && item?.epsPrior !== null}
) {#if item?.epsEst / item?.epsPrior - 1 >= 0}
: "-"} <span class="ml-1 text-[#22C55E]">
+{(
(item?.epsEst / item?.epsPrior - 1) *
100
)?.toFixed(2)}%
</span>
{:else}
<span class="ml-1 text-[#FF2F1F]">
{(
(item?.epsEst / item?.epsPrior - 1) *
100
)?.toFixed(2)}%
</span>
{/if}
{/if}
</div>
</td>
<td
class="text-white border-b-[#09090B] text-end text-sm sm:text-[1rem] whitespace-nowrap"
>
{#if item?.release === "amc"}
<svg
class="w-4 h-4 inline-block mr-1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 256 256"
><path
fill="#70A1EF"
d="M232.13 143.64a6 6 0 0 0-6-1.49a90.07 90.07 0 0 1-112.27-112.3a6 6 0 0 0-7.49-7.48a102.88 102.88 0 0 0-51.89 36.31a102 102 0 0 0 142.84 142.84a102.88 102.88 0 0 0 36.31-51.89a6 6 0 0 0-1.5-5.99m-42 48.29a90 90 0 0 1-126-126a90.9 90.9 0 0 1 35.52-28.27a102.06 102.06 0 0 0 118.69 118.69a90.9 90.9 0 0 1-28.24 35.58Z"
/></svg
>
After Close
{:else}
<svg
class="w-4 h-4 inline-block mr-1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 256 256"
><g fill="#FEC001"
><path
d="M184 128a56 56 0 1 1-56-56a56 56 0 0 1 56 56Z"
opacity=".2"
/><path
d="M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64a64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48a48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68l-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z"
/></g
></svg
>
Before Open
{/if}
</td> </td>
</tr> </tr>
{/each} {/each}