mirror of
https://github.com/restic/restic.git
synced 2026-12-04 15:44:46 +00:00
ui: allow timeformat without space between time and timezone (#22220)
This commit is contained in:
1 parent
8f4873d5d7
commit
f25ec9a5ab
3 files changed
+11
No files matched your search
@@ -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
|
||||
@@ -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",
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user