[BUGFIX] Followup to DateTimePicker exchange 03/35703/2
authorBenjamin Mack <benni@typo3.org>
Thu, 1 Jan 2015 18:29:02 +0000 (19:29 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 19 Jan 2015 22:23:42 +0000 (23:23 +0100)
The DateTimePicker exchange from ExtJS
to moment.js and twbs led to the problem
that when using FormEngine in a popup
the Date Format is not set due to the nature
of not having an iframe but a popup.

Releases: master
Resolves: #64076
Change-Id: I6c1bf2019d9ae2292f207fbd553a373c567b53a3
Reviewed-on: http://review.typo3.org/35703
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Resources/Public/JavaScript/DateTimePicker.js

index 65b5b52..71b898d 100644 (file)
@@ -479,7 +479,7 @@ class BackendController {
         */
        protected function generateJavascript() {
 
-               // Needed for tceform manipulation (date picker)
+               // Needed for FormEngine manipulation (date picker)
                $dateFormat = ($GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? array('MM-DD-YYYY', 'HH:mm MM-DD-YYYY') : array('DD-MM-YYYY', 'HH:mm DD-MM-YYYY'));
                $this->pageRenderer->addInlineSetting('DateTimePicker', 'DateFormat', $dateFormat);
                // define the window size of the element browser etc.
index 3f72c29..851873c 100644 (file)
@@ -4055,6 +4055,9 @@ class FormEngine {
 
                        $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js');
                        $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js');
+                       // Needed for FormEngine manipulation (date picker)
+                       $dateFormat = ($GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? array('MM-DD-YYYY', 'HH:mm MM-DD-YYYY') : array('DD-MM-YYYY', 'HH:mm DD-MM-YYYY'));
+                       $pageRenderer->addInlineSetting('DateTimePicker', 'DateFormat', $dateFormat);
 
                        // support placeholders for IE9 and lower
                        if ($this->clientInfo['BROWSER'] == 'msie' && $this->clientInfo['VERSION'] <= 9) {
index 734833b..b686c97 100644 (file)
@@ -20,7 +20,7 @@ define('TYPO3/CMS/Backend/DateTimePicker', ['jquery'], function ($) {
        var DateTimePicker = {
                options: {
                        fieldSelector: '.t3js-datetimepicker',
-                       format: top.TYPO3.settings.DateTimePicker.DateFormat
+                       format: (opener ? opener.top : top).TYPO3.settings.DateTimePicker.DateFormat
                }
        };