diff --git a/static/gsApp/components/productTrial/productTrialAlert.tsx b/static/gsApp/components/productTrial/productTrialAlert.tsx index 8cf972eb7660..589b501425a8 100644 --- a/static/gsApp/components/productTrial/productTrialAlert.tsx +++ b/static/gsApp/components/productTrial/productTrialAlert.tsx @@ -112,7 +112,7 @@ export function ProductTrialAlert(props: ProductTrialAlertProps) { {t('Learn More')} ); - } else if (daysLeft > 0 && daysLeft <= 7 && trial.isStarted) { + } else if (daysLeft >= 0 && daysLeft <= 7 && trial.isStarted) { alertHeader = t('%s Trial', titleCase(getProductName(trial.category))); if (isPaid && categoryUsesOnDemand) { alertText = t( diff --git a/static/gsApp/components/productTrial/productTrialTag.tsx b/static/gsApp/components/productTrial/productTrialTag.tsx index 4bf81f039eac..f6ff336da75b 100644 --- a/static/gsApp/components/productTrial/productTrialTag.tsx +++ b/static/gsApp/components/productTrial/productTrialTag.tsx @@ -1,5 +1,3 @@ -import moment from 'moment-timezone'; - import {Tag, type TagProps} from '@sentry/scraps/badge'; import {IconBusiness} from 'sentry/icons'; @@ -21,9 +19,9 @@ export function ProductTrialTag({ variant, showTrialEnded = false, }: ProductTrialTagProps) { - const now = moment(); + const daysLeft = -1 * getDaysSinceDate(trial.endDate ?? ''); - if (moment(trial.endDate).add(1, 'days').isBefore(now)) { + if (daysLeft < 0) { if (!showTrialEnded) { return null; } @@ -43,8 +41,6 @@ export function ProductTrialTag({ ); } - const daysLeft = -1 * getDaysSinceDate(trial.endDate ?? ''); - return ( } variant={variant ?? (daysLeft <= 7 ? 'warning' : 'info')}> {t('%d days left', daysLeft)}