File tree Expand file tree Collapse file tree
wcfsetup/install/files/lib/system/form/builder/field Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,11 +296,28 @@ public function readValue()
296296
297297 if ($ this ->value === '' ) {
298298 $ this ->value = null ;
299- } elseif ($ this ->getValueDateTimeObject () === null ) {
300- try {
301- $ this ->value ($ value );
302- } catch (\InvalidArgumentException ) {
303- $ this ->value = null ;
299+ } else {
300+ // Suppressing the time zone causes the generated datetime
301+ // string to omit the time zone entirely.
302+ //
303+ // This is an incorrect behavior of the JS component which we
304+ // cannot fix for compatibility reasons. We therefore implicitly
305+ // assume Zulu time here.
306+ if (
307+ $ this ->supportsTime ()
308+ && $ this ->hasFieldAttribute ('data-ignore-timezone ' )
309+ && $ this ->getFieldAttribute ('data-ignore-timezone ' ) === 'true '
310+ ) {
311+ $ value .= 'Z ' ;
312+ $ this ->value = $ value ;
313+ }
314+
315+ if ($ this ->getValueDateTimeObject () === null ) {
316+ try {
317+ $ this ->value ($ value );
318+ } catch (\InvalidArgumentException ) {
319+ $ this ->value = null ;
320+ }
304321 }
305322 }
306323 }
You can’t perform that action at this time.
0 commit comments