Fix empty datetime record value handling to not return zero timestamp
This commit is contained in:
parent
dce1b8e573
commit
6fe0b8ae83
@ -242,7 +242,12 @@ func (r *Record) setValue(name string, pos uint, value any) (err error) {
|
|||||||
case "DateTime":
|
case "DateTime":
|
||||||
// @note temporary solution to make timestamps consistent; we should handle
|
// @note temporary solution to make timestamps consistent; we should handle
|
||||||
// timezones (or the lack of) more properly
|
// timezones (or the lack of) more properly
|
||||||
auxv = cast.ToTime(auxv).Format(time.RFC3339)
|
auxt, err := cast.ToTimeE(auxv)
|
||||||
|
if err != nil || auxt.IsZero() {
|
||||||
|
auxv = ""
|
||||||
|
} else {
|
||||||
|
auxv = cast.ToTime(auxv).Format(time.RFC3339)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user