Set default time format in form binding (#1487)
This commit is contained in:
parent
40ab9de4b5
commit
7eb0f74b89
@ -178,7 +178,7 @@ func setFloatField(val string, bitSize int, field reflect.Value) error {
|
|||||||
func setTimeField(val string, structField reflect.StructField, value reflect.Value) error {
|
func setTimeField(val string, structField reflect.StructField, value reflect.Value) error {
|
||||||
timeFormat := structField.Tag.Get("time_format")
|
timeFormat := structField.Tag.Get("time_format")
|
||||||
if timeFormat == "" {
|
if timeFormat == "" {
|
||||||
return errors.New("Blank time format")
|
timeFormat = time.RFC3339
|
||||||
}
|
}
|
||||||
|
|
||||||
if val == "" {
|
if val == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user