{$stockTicker} Stock Price History

Select time frame (timePeriod = "Daily")} class="cursor-pointer hover:bg-primary" > Daily (timePeriod = "Weekly")} class="cursor-pointer hover:bg-primary" > Weekly {#if data?.user?.tier !== "Pro"} {#each ["Monthly", "Quarterly", "Annual"] as entry} goto("/pricing")} class="cursor-pointer hover:bg-primary" > {entry} {/each} {:else} (timePeriod = "Monthly")} class="cursor-pointer hover:bg-primary" > Monthly (timePeriod = "Quarterly")} class="cursor-pointer hover:bg-primary" > Quarterly (timePeriod = "Annual")} class="cursor-pointer hover:bg-primary" > Annual {/if}
{#if rawData?.length !== 0}
{#each stockList as item, index} {/each}
{#if timePeriod === "Weekly"} Week of {new Date(item?.time).toLocaleString( "en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "Europe/Berlin", }, )} {:else} {new Date(item?.time).toLocaleString("en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "Europe/Berlin", })} {/if} {item?.open?.toFixed(2)} {item?.high?.toFixed(2)} {item?.low?.toFixed(2)} {item?.close?.toFixed(2)} {item?.change !== null ? item?.change : "n/a"} {item?.changesPercentage !== null ? item?.changesPercentage + "%" : "n/a"} {item?.volume?.toLocaleString("en-US")}
{:else} {/if}