You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ly...@apache.org on 2024/02/29 02:36:00 UTC
(incubator-devlake) branch release-v0.20 updated: fix(zentao): fix parsing errors for date related fields on zentao v18.10 (#7051) (#7054)
This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch release-v0.20
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.20 by this push:
new 6e8199559 fix(zentao): fix parsing errors for date related fields on zentao v18.10 (#7051) (#7054)
6e8199559 is described below
commit 6e8199559335b1214657ec3faee40a5b4e119d3c
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Thu Feb 29 10:35:53 2024 +0800
fix(zentao): fix parsing errors for date related fields on zentao v18.10 (#7051) (#7054)
Co-authored-by: Lynwee <li...@merico.dev>
---
backend/core/models/common/iso8601time.go | 3 +++
backend/core/models/migrationscripts/archived/iso8601time.go | 3 +++
2 files changed, 6 insertions(+)
diff --git a/backend/core/models/common/iso8601time.go b/backend/core/models/common/iso8601time.go
index 6880821fe..512a22070 100644
--- a/backend/core/models/common/iso8601time.go
+++ b/backend/core/models/common/iso8601time.go
@@ -97,6 +97,9 @@ func (jt Iso8601Time) MarshalJSON() ([]byte, error) {
// 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 84af885d0..a2597fdd0 100644
--- a/backend/core/models/migrationscripts/archived/iso8601time.go
+++ b/backend/core/models/migrationscripts/archived/iso8601time.go
@@ -100,6 +100,9 @@ func (jt *Iso8601Time) UnmarshalJSON(b []byte) error {
if timeString == "null" {
return nil
}
+ if timeString == `""` {
+ return nil
+ }
if strings.Contains(timeString, "0000-00-00") {
return nil
}