Tests: Add DateTime unit test

This commit is contained in:
theresa 2022-10-31 17:15:49 +01:00
parent 06744f356c
commit cafe615ab5

View file

@ -119,6 +119,11 @@ func TestDateTime(t *testing.T) {
assert.Equal(t, "2020-10-17 17:48:24.9508123 +0000 UTC", result.UTC().String())
assert.Equal(t, "2020-10-17 17:48:24.9508123", result.Format("2006-01-02 15:04:05.999999999"))
})
t.Run("2022-09-03T17:48:26-07:00", func(t *testing.T) {
result := DateTime("2022-09-03T17:48:26-07:00", "")
assert.Equal(t, "2022-09-04 00:48:26 +0000 UTC", result.UTC().String())
assert.Equal(t, "2022-09-03 17:48:26", result.Format("2006-01-02 15:04:05"))
})
}
func TestIsTime(t *testing.T) {