瀏覽代碼

Set default time format in form binding (#1487)

Alexander Lokhman 7 年之前
父節點
當前提交
7eb0f74b89
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      binding/form_mapping.go

+ 1 - 1
binding/form_mapping.go

@@ -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 {
 	timeFormat := structField.Tag.Get("time_format")
 	if timeFormat == "" {
-		return errors.New("Blank time format")
+		timeFormat = time.RFC3339
 	}
 
 	if val == "" {