From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C354A1FF13A for ; Wed, 27 May 2026 14:26:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9176D1B3B0; Wed, 27 May 2026 14:26:50 +0200 (CEST) From: Shan Shaji To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window Date: Wed, 27 May 2026 14:26:39 +0200 Message-ID: <20260527122639.319204-1-s.shaji@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779884779849 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.149 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: PWPJPOD2ARPZ6TN5SH3OTWGNQWZC4D53 X-Message-ID-Hash: PWPJPOD2ARPZ6TN5SH3OTWGNQWZC4D53 X-MailFrom: s.shaji@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Fix an issue where the currently selected token expiry date was not displayed in the token edit window. This occurred because `epoch_to_rfc3339` returns a string containing timezone information, which is unsupported by the HTML `datetime-local` input element. As a result, the element failed to parse and show the current value. Fix this by using our custom utility function from `proxmox_yew_comp`, which correctly formats the string as `YYYY-MM-DDTHH:mm` (without the timezone offset). Signed-off-by: Shan Shaji --- ui/src/remotes/auto_installer/token_panel.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/src/remotes/auto_installer/token_panel.rs b/ui/src/remotes/auto_installer/token_panel.rs index d213f39b..ebacc18c 100644 --- a/ui/src/remotes/auto_installer/token_panel.rs +++ b/ui/src/remotes/auto_installer/token_panel.rs @@ -328,11 +328,15 @@ fn edit_input_panel(token: &AnswerToken) -> Html { tr!("Expire"), Field::new() .name("expire-at") - .value( - token - .expire_at - .and_then(|exp| proxmox_time::epoch_to_rfc3339(exp).ok()), - ) + .value(token.expire_at.and_then(|exp| { + let expiry_at = if exp == 0 { + String::new() + } else { + proxmox_yew_comp::utils::epoch_to_input_value(exp) + }; + + Some(expiry_at) + })) .placeholder(tr!("never")) .input_type(InputType::DatetimeLocal), ) -- 2.47.3