From: Andrea Zagli Date: Wed, 17 Aug 2022 10:36:58 +0000 (+0200) Subject: Form: in Map2FormElements non teneva conto della data null. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=1fc9af24019e23e7fab595fffb3d1be99528dd4e;p=zakegg_go Form: in Map2FormElements non teneva conto della data null. --- diff --git a/form.go b/form.go index 22fa73c..51b3327 100644 --- a/form.go +++ b/form.go @@ -177,7 +177,9 @@ func Map2FormElements(s map[string]interface{}, f map[string]*FormElement) { vg.Value = strings.ReplaceAll(vg.Value, ".", ",") /* TODO */ } else if strings.Contains(vg.Validation, "mydate") { - vg.Value = v.(time.Time).Format("02/01/2006") + if v != nil { + vg.Value = v.(time.Time).Format("02/01/2006") + } } else { vg.Value = fmt.Sprintf("%v", v) }