From 1fc9af24019e23e7fab595fffb3d1be99528dd4e Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 17 Aug 2022 12:36:58 +0200 Subject: [PATCH] Form: in Map2FormElements non teneva conto della data null. --- form.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) } -- 2.49.0