From 9984870caecf9f5bacc03111d33d154fd76acde5 Mon Sep 17 00:00:00 2001 From: Cliff Parnitzky Date: Mon, 27 Mar 2017 23:38:40 +0200 Subject: [PATCH] Fixes probleme with parameter `dateFormat` (see #36 ) --- .../modules/hofff_calendarfield/forms/FormCalendarField.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CT_ROOT/system/modules/hofff_calendarfield/forms/FormCalendarField.php b/CT_ROOT/system/modules/hofff_calendarfield/forms/FormCalendarField.php index 83ee1b6..4408afc 100644 --- a/CT_ROOT/system/modules/hofff_calendarfield/forms/FormCalendarField.php +++ b/CT_ROOT/system/modules/hofff_calendarfield/forms/FormCalendarField.php @@ -74,8 +74,8 @@ public function parse($arrAttributes=null) $GLOBALS['TL_JAVASCRIPT'][] = TL_ASSETS_URL . 'assets/jquery/ui/'.JQUERY_UI.'/jquery-ui.min.js'; $GLOBALS['TL_JAVASCRIPT'][] = TL_ASSETS_URL . 'assets/hofff/calendarfield/jquery.ui.datepicker/'.JQUERY_UI.'/jquery.ui.datepicker.min.js'; $GLOBALS['TL_JAVASCRIPT'][] = TL_ASSETS_URL . 'assets/hofff/calendarfield/jquery.ui.datepicker/'.JQUERY_UI.'/i18n/jquery.ui.datepicker-' . $objPage->language . '.js'; - - $dateFormat = $this->dateFormat ?: $GLOBALS['TL_CONFIG'][$this->rgxp . 'Format']; + + $dateFormat = $this->dateFormat ? $this->dateFormat : $objPage->dateFormat; if ($this->dateParseValue && $this->varValue != '') { $this->varValue = \Date::parse($dateFormat, strtotime($this->varValue)); @@ -129,7 +129,7 @@ public function parse($arrAttributes=null) } // correctly style the date format - $arrConfig['format'] = $this->dateformat_PHP_to_jQueryUI($dateFormat); + $arrConfig['dateFormat'] = $this->dateformat_PHP_to_jQueryUI($dateFormat); if (is_array($this->dateConfig)) { $arrConfig = array_replace($arrConfig, $this->dateConfig);