From b6dc37f6413982d8ef1c8428613437af9cc2d46a Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 29 Jul 2025 11:32:13 +0100 Subject: [PATCH] Fix wrong date in history view when looking at labeled version (#27450) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> GitOrigin-RevId: 87b6f82e3024334d03991db794dd11301918245e --- .../components/change-list/label-list-item.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/services/web/frontend/js/features/history/components/change-list/label-list-item.tsx b/services/web/frontend/js/features/history/components/change-list/label-list-item.tsx index 08201051c9..7462136c8a 100644 --- a/services/web/frontend/js/features/history/components/change-list/label-list-item.tsx +++ b/services/web/frontend/js/features/history/components/change-list/label-list-item.tsx @@ -47,10 +47,14 @@ function LabelListItem({ }: LabelListItemProps) { const { t } = useTranslation() - // first label - const fromVTimestamp = Date.parse(labels[labels.length - 1].created_at) - // most recent label - const toVTimestamp = Date.parse(labels[0].created_at) + // first label - use the actual version timestamp, fallback to created_at if not available + const fromLabel = labels[labels.length - 1] + const fromVTimestamp = + fromLabel.lastUpdatedTimestamp ?? Date.parse(fromLabel.created_at) + // most recent label - use the actual version timestamp, fallback to created_at if not available + const toLabel = labels[0] + const toVTimestamp = + toLabel.lastUpdatedTimestamp ?? Date.parse(toLabel.created_at) const updateRange: UpdateRange = { fromV: version,