File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
6060 }
6161
6262 if ('single_text ' === $ options ['widget ' ]) {
63- $ builder ->addViewTransformer (new DateTimeToStringTransformer ($ options ['model_timezone ' ], $ options ['view_timezone ' ], $ format ));
64-
6563 $ builder ->addEventListener (FormEvents::PRE_SUBMIT , function (FormEvent $ e ) use ($ options ) {
6664 $ data = $ e ->getData ();
6765 if ($ data && preg_match ('/^(?P<hours>\d{2}):(?P<minutes>\d{2})(?::(?P<seconds>\d{2})(?:\.\d+)?)?$/ ' , $ data , $ matches )) {
@@ -86,6 +84,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
8684 }
8785 });
8886 }
87+
88+ $ builder ->addViewTransformer (new DateTimeToStringTransformer ($ options ['model_timezone ' ], $ options ['view_timezone ' ], $ format ));
8989 } else {
9090 $ hourOptions = $ minuteOptions = $ secondOptions = [
9191 'error_bubbling ' => true ,
You can’t perform that action at this time.
0 commit comments