From: Shan Shaji <s.shaji@proxmox.com>
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 [thread overview]
Message-ID: <20260527122639.319204-1-s.shaji@proxmox.com> (raw)
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
next reply other threads:[~2026-05-27 12:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 12:26 Shan Shaji [this message]
2026-05-27 12:54 ` [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window Lukas Wagner
2026-05-27 14:02 ` applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260527122639.319204-1-s.shaji@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox