diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 18ff70e6..c2c37f57 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -382,7 +382,7 @@ export function addDays(data, days, state) { return result; } else { const differenceInTime = result - createdDate; - const differenceInDays = differenceInTime / (1000 * 60 * 60 * 24); + const differenceInDays = Math.round(differenceInTime / (1000 * 60 * 60 * 24)); return Math.abs(differenceInDays); } } diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2aa6e43f..d7ce46ba 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -3,7 +3,7 @@ import "../app.pcss"; import { Toaster } from 'svelte-french-toast'; - import {getImageURL, addDays} from '$lib/utils'; + import {getImageURL } from '$lib/utils'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; @@ -47,7 +47,8 @@ let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL; - const trialLeftDays = Math?.floor(addDays(data, 7, '')); +//const trialLeftDays = Math?.floor(addDays(data, 7, '')); + async function pushNotification() { Notification?.requestPermission()?.then(perm => { @@ -630,9 +631,8 @@ $: { Upgrade to Pro {#if data?.user?.freeTrial === true} - You have only - {trialLeftDays} days - left on your free trial. Upgrade now for unlimited access to all features! + Your free trial will be expired soon. + Upgrade now for unlimited access to all features! {:else} Unlock all features of the platform and level up your trading. {/if} @@ -930,9 +930,8 @@ $: { Upgrade to Pro {#if data?.user?.freeTrial === true} - You have only - {trialLeftDays} days - left on your free trial. Upgrade now for unlimited access to all features! + Your free trial will expire soon. + Upgrade now for unlimited access to all features! {:else} Unlock all features of the platform and level up your trading. {/if} diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte index bfbf1fa7..5b762174 100644 --- a/src/routes/home/+page.svelte +++ b/src/routes/home/+page.svelte @@ -197,7 +197,7 @@ async function loadSearchData() {
- +