diff --git a/frontend/src/components/App.tsx b/frontend/src/components/App.tsx index 275b8e852..3ef214bdc 100644 --- a/frontend/src/components/App.tsx +++ b/frontend/src/components/App.tsx @@ -362,6 +362,12 @@ class LicenseNotification extends Component { const withRemainingTime = api.licenses.map(x => { const remainingSec = x.expiresAt - unixNow; const remainingDays = remainingSec / (60 * 60 * 24); + + const expiredForMoreThanAYear = (remainingSec < 0 && remainingDays < -365); + const prettyDuration = expiredForMoreThanAYear + ? 'over a year' + : prettyMilliseconds(Math.abs(remainingSec) * 1000, { unitCount: 2, verbose: true, secondsDecimalDigits: 0 }); + return { ...x, remainingSec, @@ -370,7 +376,7 @@ class LicenseNotification extends Component { isExpired: remainingSec <= 0, sourceDisplayName: sourceNames[x.source] ?? x.source, typeDisplayName: typeNames[x.type] ?? x.type, - prettyDuration: prettyMilliseconds(remainingSec * 1000, { unitCount: 2, verbose: true }), + prettyDuration, prettyDateTime: new Date(x.expiresAt * 1000).toLocaleDateString(), }; }); @@ -383,7 +389,7 @@ class LicenseNotification extends Component { {warnings.map(e =>
- Your Redpanda Enterprise license ({e.sourceDisplayName})   + Your Redpanda Enterprise license ({e.sourceDisplayName}) {e.isExpired ? <> has expired {e.prettyDateTime} ({e.prettyDuration} ago) : <> will expire {e.prettyDateTime} ({e.prettyDuration} remaining)