commit | 6e8199559335b1214657ec3faee40a5b4e119d3c | [log] [tgz] |
---|---|---|
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | Thu Feb 29 10:35:53 2024 +0800 |
committer | GitHub <noreply@github.com> | Thu Feb 29 10:35:53 2024 +0800 |
tree | 906553b68e4240878160094d8bfa687cbe61ee56 | |
parent | 0f11da903e3f182d14d5f3b413fac29d57a60451 [diff] |
fix(zentao): fix parsing errors for date related fields on zentao v18.10 (#7051) (#7054) Co-authored-by: Lynwee <linwei.hou@merico.dev>
diff --git a/backend/core/models/common/iso8601time.go b/backend/core/models/common/iso8601time.go index 6880821..512a220 100644 --- a/backend/core/models/common/iso8601time.go +++ b/backend/core/models/common/iso8601time.go
@@ -97,6 +97,9 @@ // UnmarshalJSON FIXME ... func (jt *Iso8601Time) UnmarshalJSON(b []byte) error { timeString := string(b) + if timeString == `""` { + return nil + } if timeString == "null" { return nil }
diff --git a/backend/core/models/migrationscripts/archived/iso8601time.go b/backend/core/models/migrationscripts/archived/iso8601time.go index 84af885..a2597fd 100644 --- a/backend/core/models/migrationscripts/archived/iso8601time.go +++ b/backend/core/models/migrationscripts/archived/iso8601time.go
@@ -100,6 +100,9 @@ if timeString == "null" { return nil } + if timeString == `""` { + return nil + } if strings.Contains(timeString, "0000-00-00") { return nil }