From 130aba34dc43d1b4f7b889f459697b40602d5692 Mon Sep 17 00:00:00 2001 From: Nick Meisenheimer Date: Tue, 7 Jul 2026 15:28:40 +0000 Subject: [PATCH 1/2] fix(trials): show 'Trial ended' instead of negative days left when product trial expires Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> --- static/gsApp/components/productTrial/productTrialTag.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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)} From c52550f65f8f3764287d227774452808448a6d78 Mon Sep 17 00:00:00 2001 From: Nick Meisenheimer Date: Tue, 7 Jul 2026 17:25:12 +0000 Subject: [PATCH 2/2] fix(trials): show trial alert when 0 days left on product trial When daysLeft === 0 (trial ends today), ProductTrialAlert fell through all conditional branches without matching any, leaving alertHeader and alertText null and rendering an empty invisible alert. Include daysLeft === 0 in the 0-7 days remaining branch by changing the condition from daysLeft > 0 to daysLeft >= 0. Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> --- static/gsApp/components/productTrial/productTrialAlert.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(