Fix date fields not being nulled correctly when cleared (#3243)

* Interpret empty string date as null
* Fix setSQLiteDate for null
This commit is contained in:
WithoutPants
2022-12-06 13:33:58 +11:00
committed by GitHub
parent c9b0841184
commit 782bed9df8
3 changed files with 7 additions and 6 deletions

View File

@@ -143,7 +143,7 @@ func (t changesetTranslator) optionalDate(value *string, field string) models.Op
return models.OptionalDate{}
}
if value == nil {
if value == nil || *value == "" {
return models.OptionalDate{
Set: true,
Null: true,