Increase min year for dates in file names #304

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-20 19:58:59 +02:00
parent 1297a8cc1f
commit 5f6c2af78e
2 changed files with 7 additions and 1 deletions

View file

@ -13,7 +13,7 @@ var DateTimeRegexp = regexp.MustCompile("\\d{4}[\\-_]\\d{2}[\\-_]\\d{2}.{1,4}\\d
var DateIntRegexp = regexp.MustCompile("\\d{1,4}")
var (
YearMin = 1000
YearMin = 1990
YearMax = time.Now().Year() + 3
)

View file

@ -120,6 +120,12 @@ func TestTime(t *testing.T) {
assert.False(t, result.IsZero())
assert.Equal(t, "2019-01-03 00:00:00 +0000 UTC", result.String())
})
t.Run("/1989/1/3/foo.jpg", func(t *testing.T) {
result := Time("/1989/1/3/foo.jpg")
assert.True(t, result.IsZero())
assert.Equal(t, "0001-01-01 00:00:00 +0000 UTC", result.String())
})
}
func TestInt(t *testing.T) {