diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-05-15 03:17:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 20:17:06 +0100 |
commit | f6be429781b24b1ac3b6e719b9c64df33866db93 (patch) | |
tree | dec0c6c9fb4f4d146f76b96f463a448494bcd010 /vendor/xorm.io/xorm/session_convert.go | |
parent | e2f39c2b64e1c5360702e507e0cac56255ca61c3 (diff) | |
download | gitea-f6be429781b24b1ac3b6e719b9c64df33866db93.tar.gz gitea-f6be429781b24b1ac3b6e719b9c64df33866db93.zip |
Upgrade xorm to v1.1.0 (#15869)
Diffstat (limited to 'vendor/xorm.io/xorm/session_convert.go')
-rw-r--r-- | vendor/xorm.io/xorm/session_convert.go | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/vendor/xorm.io/xorm/session_convert.go b/vendor/xorm.io/xorm/session_convert.go index 4a4dd8be00..a683994731 100644 --- a/vendor/xorm.io/xorm/session_convert.go +++ b/vendor/xorm.io/xorm/session_convert.go @@ -168,29 +168,7 @@ func (session *Session) bytes2Value(col *schemas.Column, fieldValue *reflect.Val } else if strings.EqualFold(sdata, "false") { x = 0 } else { - if col.SQLType.Name == schemas.DateTime { - if len(sdata) == 20 { - t, err := time.Parse("2006-01-02T15:04:05Z", sdata) - if err != nil { - return fmt.Errorf("arg %v as int: %s", key, err.Error()) - } - x = t.Unix() - } else if len(sdata) == 19 { - var parseFormat = "2006-01-02 15:04:05" - if sdata[10] == 'T' { - parseFormat = "2006-01-02T15:04:05" - } - t, err := time.Parse(parseFormat, sdata) - if err != nil { - return fmt.Errorf("arg %v as int: %s", key, err.Error()) - } - x = t.Unix() - } else { - x, err = strconv.ParseInt(sdata, 10, 64) - } - } else { - x, err = strconv.ParseInt(sdata, 10, 64) - } + x, err = strconv.ParseInt(sdata, 10, 64) } if err != nil { return fmt.Errorf("arg %v as int: %s", key, err.Error()) |