File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
lib/internal/Magento/Framework/Data/Form/Element Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,14 @@ public function setValue($value)
82
82
$ this ->_value = $ value ;
83
83
return $ this ;
84
84
}
85
+ if (preg_match ('/^[0-9]+$/ ' , $ value )) {
86
+ $ this ->_value = (new \DateTime ())->setTimestamp ($ this ->_toTimestamp ($ value ));
87
+
88
+ return $ this ;
89
+ }
90
+
85
91
try {
86
- if (preg_match ('/^[0-9]+$/ ' , $ value )) {
87
- $ this ->_value = (new \DateTime ())->setTimestamp ($ this ->_toTimestamp ($ value ));
88
- } else {
89
- $ this ->_value = new \DateTime ($ value );
90
- $ this ->_value ->setTimezone (new \DateTimeZone ($ this ->localeDate ->getConfigTimezone ()));
91
- }
92
+ $ this ->_value = new \DateTime ($ value , new \DateTimeZone ($ this ->localeDate ->getConfigTimezone ()));
92
93
} catch (\Exception $ e ) {
93
94
$ this ->_value = '' ;
94
95
}
You can’t perform that action at this time.
0 commit comments