1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 20:17:05 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-12-02 16:24:56 +02:00
parent ad2ec68c34
commit 968a9ec06c
3 changed files with 86 additions and 23 deletions

View File

@@ -39,11 +39,12 @@ func (t *SimpleDate) UnmarshalJSON(data []byte) error {
}
data = trimQuotes(data)
dataStr := string(data)
if len(dataStr) == 0 {
return nil // as an excepption here, allow empty "" on simple dates, as the server would render it on a response: https://endomedical.slack.com/archives/D02BF660JA1/p1630486704048100.
if len(data) == 0 {
return nil // as an excepption here, allow empty "" on simple dates, as the server would render it on a response.
}
dataStr := string(data)
tt, err := time.Parse(SimpleDateLayout, dataStr)
if err != nil {
return err