From 71d043c1640914e707e3ad15eb7f74091a7bf41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Thu, 11 Dec 2025 16:54:43 +0100 Subject: [PATCH] fix: estimated removal date in the timeline --- assets/components/search/EventTimeline.tsx | 9 ++++++--- translations/translations.pot | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/assets/components/search/EventTimeline.tsx b/assets/components/search/EventTimeline.tsx index c6d7c1a..ef85c81 100644 --- a/assets/components/search/EventTimeline.tsx +++ b/assets/components/search/EventTimeline.tsx @@ -9,10 +9,10 @@ import {ThunderboltOutlined} from "@ant-design/icons" import {t} from "ttag" import type {TimeLineItemProps} from "antd/lib/timeline/TimelineItem" -function getWhoisRemoveTimelineEvent(whoisRemoveDateEstimate: Date, withRenewalPeriod = false) { +function getWhoisRemoveTimelineEvent(whoisRemoveDateEstimate: Date, withRenewalPeriod?: boolean) { const locale = navigator.language.split('-')[0] const sm = useBreakpoint('sm') - const eventName = withRenewalPeriod ? t`Estimated removal (incl. renewal)` : t`Estimated removal (excl. renewal)` + const eventName = withRenewalPeriod === undefined ? t`Estimated removal` : withRenewalPeriod ? t`Estimated removal (incl. renewal)` : t`Estimated removal (excl. renewal)` const eventDetail = t`Estimated WHOIS removal date. This is the latest date this record would be deleted, according to ICANN's standard lifecycle. Note that some registries have their own lifecycles.` const dateStr = @@ -56,14 +56,17 @@ export function EventTimeline({events, expiresInDays, isRenewalPeriod}: { if (expiresInDays !== undefined) { const whoisRemoveDateEstimate = new Date(new Date().getTime() + expiresInDays * 24 * 60 * 60 * 1e3) - items.push(getWhoisRemoveTimelineEvent(whoisRemoveDateEstimate, true)) const expirationEvent = sortedEvents.find(e => !e.deleted && e.action === 'expiration') const lastExpirationEvent = sortedEvents.find(e => e.deleted && e.action === 'expiration') if (expirationEvent && lastExpirationEvent && isRenewalPeriod) { + items.push(getWhoisRemoveTimelineEvent(whoisRemoveDateEstimate, true)) + const date = new Date(whoisRemoveDateEstimate.getTime() - (new Date(expirationEvent.date).getTime() - new Date(lastExpirationEvent.date).getTime())) items.push(getWhoisRemoveTimelineEvent(date, false)) + } else { + items.push(getWhoisRemoveTimelineEvent(whoisRemoveDateEstimate)) } } diff --git a/translations/translations.pot b/translations/translations.pot index 0f6ca8b..ea3d6fb 100644 --- a/translations/translations.pot +++ b/translations/translations.pot @@ -185,6 +185,10 @@ msgstr "" msgid "This domain name does not appear to be valid" msgstr "" +#: assets/components/search/EventTimeline.tsx:15 +msgid "Estimated removal" +msgstr "" + #: assets/components/search/EventTimeline.tsx:15 msgid "Estimated removal (incl. renewal)" msgstr ""