From f25ec9a5ab18fbb6797ab336b995d6639d62c4d4 Mon Sep 17 00:00:00 2001 From: Michael Eischer <9106997+MichaelEischer@users.noreply.github.com> Date: Tue, 24 Nov 2026 19:58:09 +0100 Subject: [PATCH] ui: allow timeformat without space between time and timezone (#22220) --- changelog/unreleased/issue-2065 | 3 +++ internal/ui/format.go | 2 ++ internal/ui/format_test.go | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/changelog/unreleased/issue-2065 b/changelog/unreleased/issue-2065 index 8ecadfec9..a472e0e7a 100644 --- a/changelog/unreleased/issue-2065 +++ b/changelog/unreleased/issue-2065 @@ -20,10 +20,13 @@ With additional modifiers for timezone name and timezone offset: ``` y-m-d HH:MM:SS MST y-m-d HH:MM:SS -0700 +y-m-d HH:MM:SS-0700 d.m.y HH:MM:SS MST d.m.y HH:MM:SS -0700 +d.m.y HH:MM:SS-0700 ``` https://github.com/restic/restic/issues/2065 https://github.com/restic/restic/pull/21867 +https://github.com/restic/restic/pull/22220 diff --git a/internal/ui/format.go b/internal/ui/format.go index 63c74b893..a9300008e 100644 --- a/internal/ui/format.go +++ b/internal/ui/format.go @@ -193,6 +193,7 @@ var timeFormats = []string{ "2006-1-2", "2006-1-2 15:04", "2006-1-2 15:04:05", + "2006-1-2 15:04:05-0700", "2006-1-2 15:04:05 -0700", "2006-1-2 15:04:05 MST", @@ -200,6 +201,7 @@ var timeFormats = []string{ "2.1.2006", "2.1.2006 15:04", "2.1.2006 15:04:05", + "2.1.2006 15:04:05-0700", "2.1.2006 15:04:05 -0700", "2.1.2006 15:04:05 MST", diff --git a/internal/ui/format_test.go b/internal/ui/format_test.go index e359501ac..563a38870 100644 --- a/internal/ui/format_test.go +++ b/internal/ui/format_test.go @@ -193,6 +193,9 @@ func TestParseTime(t *testing.T) { { time: "2026-11-11 23:00:00 +0200", }, + { + time: "2026-11-11 23:00:00+0200", + }, { time: "2026-13-1", err: true, @@ -234,6 +237,9 @@ func TestParseTime(t *testing.T) { { time: "01.08.2026 12:00:01 +0200", }, + { + time: "01.08.2026 12:00:01+0200", + }, { time: "29.02.2027", err: true,