Skip to content

Commit

Permalink
fix(zentao): fix parsing errors for date related fields on zentao v18…
Browse files Browse the repository at this point in the history
….10 (#7051) (#7054)

Co-authored-by: Lynwee <linwei.hou@merico.dev>
  • Loading branch information
github-actions[bot] and d4x1 authored Feb 29, 2024
1 parent 0f11da9 commit 6e81995
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/core/models/common/iso8601time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions backend/core/models/migrationscripts/archived/iso8601time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6e81995

Please sign in to comment.