Skip to content
Myr

Set default time format in form binding (#1487)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alexander Lokhman · committed by Bo-Yi Wu · parent 40ab9de · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:binding/form_mapping.go+1 added-1 removed
176 unmodified lines
177178func setTimeField(val string, structField reflect.StructField, value reflect.Value) error {179 timeFormat := structField.Tag.Get("time_format")180 if timeFormat == "" {181 return errors.New("Blank time format")181 timeFormat = time.RFC3339182 }183184 if val == "" {185 value.Set(reflect.ValueOf(time.Time{}))
24 unmodified lines