ui fix
This commit is contained in:
parent
4c8a9cbd53
commit
09f2c137d1
@ -90,7 +90,7 @@ $: {
|
|||||||
What do you think of {$stockTicker} today?
|
What do you think of {$stockTicker} today?
|
||||||
</label>
|
</label>
|
||||||
<span class="text-white text-sm sm:text-[1rem] mt-1">
|
<span class="text-white text-sm sm:text-[1rem] mt-1">
|
||||||
The community is {upvote > downvote ? 'bullish' : upvote < downvote ? 'bearish' : 'neutral'} about {$displayCompanyName} this week, , with {totalVote} total votes.
|
The community is {upvote > downvote ? 'bullish' : upvote < downvote ? 'bearish' : 'neutral'} about {$displayCompanyName} this week, with {totalVote} total votes.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -46,13 +46,14 @@ const fetchWatchlist = async (pb, userId) => {
|
|||||||
const fetchCommunitySentiment = async (pb, ticker, cookies) => {
|
const fetchCommunitySentiment = async (pb, ticker, cookies) => {
|
||||||
const cookieVote = cookies.get(`community-sentiment-${ticker}`);
|
const cookieVote = cookies.get(`community-sentiment-${ticker}`);
|
||||||
const today = new Date().toISOString().split("T")[0];
|
const today = new Date().toISOString().split("T")[0];
|
||||||
const tomorrow = new Date(new Date().setDate(new Date().getDate() + 7))
|
const pastNDays = new Date(new Date().setDate(new Date().getDate() - 7))
|
||||||
.toISOString()
|
.toISOString()
|
||||||
.split("T")[0];
|
.split("T")[0];
|
||||||
|
|
||||||
const output = await pb.collection("sentiment").getFullList({
|
const output = await pb.collection("sentiment").getFullList({
|
||||||
filter: `ticker="${ticker}" && created >= "${today}" && created < "${tomorrow}"`,
|
filter: `ticker="${ticker}" && created < "${today}" && created >= "${pastNDays}"`,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
alreadyVoted: cookieVote || null,
|
alreadyVoted: cookieVote || null,
|
||||||
sentimentData: output?.at(0) || {},
|
sentimentData: output?.at(0) || {},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user