public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window
@ 2026-05-27 12:26 Shan Shaji
  2026-05-27 12:54 ` Lukas Wagner
  2026-05-27 14:02 ` applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Shan Shaji @ 2026-05-27 12:26 UTC (permalink / raw)
  To: pdm-devel

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 <s.shaji@proxmox.com>
---
 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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-27 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 12:26 [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window Shan Shaji
2026-05-27 12:54 ` Lukas Wagner
2026-05-27 14:02 ` applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal