ui: allow timeformat without space between time and timezone (#22220)

This commit is contained in:
Michael Eischer authored and GitHub committed 2026-11-24 19:58:09 +01:00
1 parent 8f4873d5d7
commit f25ec9a5ab
3 files changed
+11

No files matched your search

+3
View File
@@ -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
+2
View File
@@ -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",
+6
View File
@@ -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,