diff --git a/src/lib/components/BullBearSay.svelte b/src/lib/components/BullBearSay.svelte index e56476a6..637d8356 100644 --- a/src/lib/components/BullBearSay.svelte +++ b/src/lib/components/BullBearSay.svelte @@ -6,6 +6,23 @@ let rawData = {}; +function latestInfoDate(inputDate) { + // Convert the input date string to milliseconds since epoch + const inputDateMs = Date?.parse(inputDate); + + // Get today's date in milliseconds since epoch + const todayMs = Date?.now(); + + // Calculate the difference in milliseconds + const differenceInMs = todayMs - inputDateMs; + + // Convert milliseconds to days + const differenceInDays = Math?.floor(differenceInMs / (1000 * 60 * 60 * 24)); + + // Return the difference in days + return differenceInDays <=1; +} + function handleMode(i) { activeIdx = i; @@ -81,8 +98,9 @@ + Updated {rawData?.date} - +