* [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
* Re: [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window
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
1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2026-05-27 12:54 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
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 <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),
> )
Was about to try to fix the same issue, but you were quicker :)
Can confirm that this fixes the issue:
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* applied: [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window
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 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2026-05-27 14:02 UTC (permalink / raw)
To: pdm-devel, Shan Shaji
On Wed, 27 May 2026 14:26:39 +0200, 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.
>
> [...]
Applied, thanks!
[1/1] ui: token_panel: show date and time correctly in token edit window
commit: 2b9297be161df9f0b3f6a1d42de86ff393736abd
^ permalink raw reply [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