From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 26CFC1FF13A for ; Wed, 27 May 2026 14:54:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 095DC1C409; Wed, 27 May 2026 14:54:22 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 27 May 2026 14:54:18 +0200 Message-Id: Subject: Re: [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window From: "Lukas Wagner" To: "Shan Shaji" , X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260527122639.319204-1-s.shaji@proxmox.com> In-Reply-To: <20260527122639.319204-1-s.shaji@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779886432133 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 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: NYQEE4YBPONE5JNCYOPE3O5GN55T34WN X-Message-ID-Hash: NYQEE4YBPONE5JNCYOPE3O5GN55T34WN X-MailFrom: l.wagner@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: On Wed May 27, 2026 at 2:26 PM CEST, Shan Shaji wrote: > 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/remote= s/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(e= xp).ok()), > - ) > + .value(token.expire_at.and_then(|exp| { > + let expiry_at =3D if exp =3D=3D 0 { > + String::new() > + } else { > + proxmox_yew_comp::utils::epoch_to_input_value(ex= p) > + }; > + > + Some(expiry_at) > + })) > .placeholder(tr!("never")) > .input_type(InputType::DatetimeLocal), > ) Was about to try to fix the same issue, but you were quicker :) Can confirm that this fixes the issue: Tested-by: Lukas Wagner