Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrajat committed Jan 21, 2025
1 parent d4e9135 commit 7a9084e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ const CONST = {
get DIRECT_REIMBURSEMENT_CURRENCIES() {
return [this.CURRENCY.USD, this.CURRENCY.AUD, this.CURRENCY.CAD, this.CURRENCY.GBP, this.CURRENCY.EUR];
},
TRIAL_DURATION_DAYS: 8,
EXAMPLE_PHONE_NUMBER: '+15005550006',
CONCIERGE_CHAT_NAME: 'Concierge',
CLOUDFRONT_URL,
Expand Down
6 changes: 3 additions & 3 deletions src/libs/SubscriptionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ function shouldShowDiscountBanner(): boolean {
return false;
}

const dateNow = Date.now() / 1000;
const dateNow = Math.floor(Date.now() / 1000);
const firstDayTimestamp = fromZonedTime(`${firstDayFreeTrial}`, 'UTC').getTime() / 1000;
const lastDayTimestamp = fromZonedTime(`${lastDayFreeTrial}`, 'UTC').getTime() / 1000;
if (dateNow > lastDayTimestamp) {
return false;
}

return dateNow <= firstDayTimestamp + CONST.TRIAL_DURATION * CONST.DATE.SECONDS_PER_DAY;
return dateNow <= firstDayTimestamp + CONST.TRIAL_DURATION_DAYS * CONST.DATE.SECONDS_PER_DAY;
}

function getEarlyDiscountInfo(): DiscountInfo | null {
Expand All @@ -275,7 +275,7 @@ function getEarlyDiscountInfo(): DiscountInfo | null {
if (timeLeft24 > 0) {
timeLeftInSeconds = timeLeft24;
} else {
timeLeftInSeconds = firstDayTimestamp + 8 * CONST.DATE.SECONDS_PER_DAY - dateNow;
timeLeftInSeconds = firstDayTimestamp + CONST.TRIAL_DURATION_DAYS * CONST.DATE.SECONDS_PER_DAY - dateNow;
}

if (timeLeftInSeconds <= 0) {
Expand Down

0 comments on commit 7a9084e

Please sign in to comment.